瀏覽代碼

fix: 修复注册首次获取验证码验证不通过

李书文 1 年之前
父節點
當前提交
de23782bca
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      sp-service/sp-admin/src/main/java/com/pj/project/app_user/AppUserService.java

+ 1 - 1
sp-service/sp-admin/src/main/java/com/pj/project/app_user/AppUserService.java

@@ -214,7 +214,7 @@ public class AppUserService extends ServiceImpl<AppUserMapper, AppUser> implemen
         String smsCode = RedisUtil.get(PREFIX + registerDto.getPhone());
         if (smsCode == null) throw new RuntimeException("验证码已过期,请重新发送!");
         //比对验证码
-        if (!registerDto.getSmsCode().toString().equals(smsCode)) throw new SecurityException("验证码输入错误,请检查!");
+        if (registerDto.getSmsCode()!=Integer.parseInt(smsCode)) throw new SecurityException("验证码输入错误,请检查!");
         //4.开始新增
         AppUser appUser = new AppUser();
         //手机号