Browse Source

短信验证码接口

zouxuan 1 year ago
parent
commit
ef11688c29

+ 1 - 1
mec-application/src/main/java/com/ym/mec/student/controller/SmsCodeController.java

@@ -43,7 +43,7 @@ public class SmsCodeController extends BaseController {
     }
 
     @ApiOperation(value = "发送登录短信验证码")
-    @ApiImplicitParams({ @ApiImplicitParam(name = "phone", value = "手机号", required = true, dataType = "String"),
+    @ApiImplicitParams({ @ApiImplicitParam(name = "mobile", value = "手机号", required = true, dataType = "String"),
             @ApiImplicitParam(name = "code", value = "验证码", required = true, dataType = "String") })
     @PostMapping(value = "/sendSmsCode")
     public HttpResponseResult<Object> sendLoginVerifyCode1(String mobile, String code) throws Exception {

+ 1 - 1
mec-application/src/main/java/com/ym/mec/teacher/controller/SmsCodeController.java

@@ -43,7 +43,7 @@ public class SmsCodeController extends BaseController {
     }
 
     @ApiOperation(value = "发送登录短信验证码")
-    @ApiImplicitParams({ @ApiImplicitParam(name = "phone", value = "手机号", required = true, dataType = "String"),
+    @ApiImplicitParams({ @ApiImplicitParam(name = "mobile", value = "手机号", required = true, dataType = "String"),
             @ApiImplicitParam(name = "code", value = "验证码", required = true, dataType = "String") })
     @PostMapping(value = "/sendSmsCode")
     public HttpResponseResult<Object> sendLoginVerifyCode1(String mobile, String code) throws Exception {

+ 5 - 5
mec-application/src/main/java/com/ym/mec/web/controller/SmsCodeController.java

@@ -43,18 +43,18 @@ public class SmsCodeController extends BaseController {
     }
 
     @ApiOperation(value = "发送登录短信验证码")
-    @ApiImplicitParams({ @ApiImplicitParam(name = "phone", value = "手机号", required = true, dataType = "String"),
+    @ApiImplicitParams({ @ApiImplicitParam(name = "mobile", value = "手机号", required = true, dataType = "String"),
             @ApiImplicitParam(name = "code", value = "验证码", required = true, dataType = "String") })
     @PostMapping(value = "/sendSmsCode")
-    public HttpResponseResult<Object> sendLoginVerifyCode1(String phone, String code) throws Exception {
-        if(StringUtils.isEmpty(phone) || StringUtils.isEmpty(code)){
+    public HttpResponseResult<Object> sendLoginVerifyCode1(String mobile, String code) throws Exception {
+        if(StringUtils.isEmpty(mobile) || StringUtils.isEmpty(code)){
             return failed(SecurityConstants.PARAM_VERIFY_EXCEPTION);
         }
-        String redisKey = MessageTypeEnum.KAPTCHA_SESSION_KEY + phone;
+        String redisKey = MessageTypeEnum.KAPTCHA_SESSION_KEY + mobile;
         RBucket<String> bucket = redissonClient.getBucket(redisKey);
         if(bucket.isExists()){
             if(StringUtils.equalsIgnoreCase(bucket.get(),code)){
-                smsCodeService.sendValidCode(phone);
+                smsCodeService.sendValidCode(mobile);
                 return succeed();
             }
         }