From 4021df78e8854017a11f8f2230d9e076fe33b66c Mon Sep 17 00:00:00 2001 From: Odboy Date: Thu, 30 Oct 2025 22:46:00 +0800 Subject: [PATCH] =?UTF-8?q?fix(system):=20=E6=A0=A1=E9=AA=8C=E9=82=AE?= =?UTF-8?q?=E7=AE=B1=E9=AA=8C=E8=AF=81=E7=A0=81=E6=97=B6=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E4=B8=9A=E5=8A=A1=E7=B1=BB=E5=9E=8B=E6=A3=80=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cn/odboy/system/controller/SystemCaptchaController.java | 4 ++++ .../cn/odboy/system/controller/SystemCaptchaController.java | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/cutejava-springboot3/cutejava-module-system/src/main/java/cn/odboy/system/controller/SystemCaptchaController.java b/cutejava-springboot3/cutejava-module-system/src/main/java/cn/odboy/system/controller/SystemCaptchaController.java index ec448a9c..8e136cef 100644 --- a/cutejava-springboot3/cutejava-module-system/src/main/java/cn/odboy/system/controller/SystemCaptchaController.java +++ b/cutejava-springboot3/cutejava-module-system/src/main/java/cn/odboy/system/controller/SystemCaptchaController.java @@ -16,6 +16,7 @@ package cn.odboy.system.controller; +import cn.odboy.framework.exception.BadRequestException; import cn.odboy.system.constant.SystemCaptchaBizEnum; import cn.odboy.system.dal.model.SystemCheckEmailCaptchaArgs; import cn.odboy.system.service.SystemEmailService; @@ -51,6 +52,9 @@ public class SystemCaptchaController { @PostMapping(value = "/checkEmailCaptcha") public ResponseEntity checkEmailCaptcha(@Validated @RequestBody SystemCheckEmailCaptchaArgs args) { SystemCaptchaBizEnum biEnum = SystemCaptchaBizEnum.getByBizCode(args.getBizCode()); + if (biEnum == null) { + throw new BadRequestException("不支持的业务"); + } systemEmailService.checkEmailCaptcha(biEnum, args.getEmail(), args.getCode()); return ResponseEntity.ok(null); } diff --git a/cutejava/cutejava-module-system/src/main/java/cn/odboy/system/controller/SystemCaptchaController.java b/cutejava/cutejava-module-system/src/main/java/cn/odboy/system/controller/SystemCaptchaController.java index 574e2521..a82fa117 100644 --- a/cutejava/cutejava-module-system/src/main/java/cn/odboy/system/controller/SystemCaptchaController.java +++ b/cutejava/cutejava-module-system/src/main/java/cn/odboy/system/controller/SystemCaptchaController.java @@ -16,6 +16,7 @@ package cn.odboy.system.controller; +import cn.odboy.framework.exception.BadRequestException; import cn.odboy.system.constant.SystemCaptchaBizEnum; import cn.odboy.system.dal.model.SystemCheckEmailCaptchaArgs; import cn.odboy.system.service.SystemEmailService; @@ -52,6 +53,9 @@ public class SystemCaptchaController { @PostMapping(value = "/checkEmailCaptcha") public ResponseEntity checkEmailCaptcha(@Validated @RequestBody SystemCheckEmailCaptchaArgs args) { SystemCaptchaBizEnum biEnum = SystemCaptchaBizEnum.getByBizCode(args.getBizCode()); + if (biEnum == null) { + throw new BadRequestException("不支持的业务"); + } systemEmailService.checkEmailCaptcha(biEnum, args.getEmail(), args.getCode()); return ResponseEntity.ok(null); }