fix(system): 校验邮箱验证码时增加业务类型检查
This commit is contained in:
+4
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
package cn.odboy.system.controller;
|
package cn.odboy.system.controller;
|
||||||
|
|
||||||
|
import cn.odboy.framework.exception.BadRequestException;
|
||||||
import cn.odboy.system.constant.SystemCaptchaBizEnum;
|
import cn.odboy.system.constant.SystemCaptchaBizEnum;
|
||||||
import cn.odboy.system.dal.model.SystemCheckEmailCaptchaArgs;
|
import cn.odboy.system.dal.model.SystemCheckEmailCaptchaArgs;
|
||||||
import cn.odboy.system.service.SystemEmailService;
|
import cn.odboy.system.service.SystemEmailService;
|
||||||
@@ -51,6 +52,9 @@ public class SystemCaptchaController {
|
|||||||
@PostMapping(value = "/checkEmailCaptcha")
|
@PostMapping(value = "/checkEmailCaptcha")
|
||||||
public ResponseEntity<Void> checkEmailCaptcha(@Validated @RequestBody SystemCheckEmailCaptchaArgs args) {
|
public ResponseEntity<Void> checkEmailCaptcha(@Validated @RequestBody SystemCheckEmailCaptchaArgs args) {
|
||||||
SystemCaptchaBizEnum biEnum = SystemCaptchaBizEnum.getByBizCode(args.getBizCode());
|
SystemCaptchaBizEnum biEnum = SystemCaptchaBizEnum.getByBizCode(args.getBizCode());
|
||||||
|
if (biEnum == null) {
|
||||||
|
throw new BadRequestException("不支持的业务");
|
||||||
|
}
|
||||||
systemEmailService.checkEmailCaptcha(biEnum, args.getEmail(), args.getCode());
|
systemEmailService.checkEmailCaptcha(biEnum, args.getEmail(), args.getCode());
|
||||||
return ResponseEntity.ok(null);
|
return ResponseEntity.ok(null);
|
||||||
}
|
}
|
||||||
|
|||||||
+4
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
package cn.odboy.system.controller;
|
package cn.odboy.system.controller;
|
||||||
|
|
||||||
|
import cn.odboy.framework.exception.BadRequestException;
|
||||||
import cn.odboy.system.constant.SystemCaptchaBizEnum;
|
import cn.odboy.system.constant.SystemCaptchaBizEnum;
|
||||||
import cn.odboy.system.dal.model.SystemCheckEmailCaptchaArgs;
|
import cn.odboy.system.dal.model.SystemCheckEmailCaptchaArgs;
|
||||||
import cn.odboy.system.service.SystemEmailService;
|
import cn.odboy.system.service.SystemEmailService;
|
||||||
@@ -52,6 +53,9 @@ public class SystemCaptchaController {
|
|||||||
@PostMapping(value = "/checkEmailCaptcha")
|
@PostMapping(value = "/checkEmailCaptcha")
|
||||||
public ResponseEntity<Void> checkEmailCaptcha(@Validated @RequestBody SystemCheckEmailCaptchaArgs args) {
|
public ResponseEntity<Void> checkEmailCaptcha(@Validated @RequestBody SystemCheckEmailCaptchaArgs args) {
|
||||||
SystemCaptchaBizEnum biEnum = SystemCaptchaBizEnum.getByBizCode(args.getBizCode());
|
SystemCaptchaBizEnum biEnum = SystemCaptchaBizEnum.getByBizCode(args.getBizCode());
|
||||||
|
if (biEnum == null) {
|
||||||
|
throw new BadRequestException("不支持的业务");
|
||||||
|
}
|
||||||
systemEmailService.checkEmailCaptcha(biEnum, args.getEmail(), args.getCode());
|
systemEmailService.checkEmailCaptcha(biEnum, args.getEmail(), args.getCode());
|
||||||
return ResponseEntity.ok(null);
|
return ResponseEntity.ok(null);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user