|
@@ -271,10 +271,6 @@ public class SysAuthServiceImpl implements SysAuthService {
|
|
|
// 判断短信验证码是否正确
|
|
|
String redisKey = APPLICATION_NAME + "-sms-login" + "-" + phone;
|
|
|
Integer smsCode = redisUtil.getCacheObject(redisKey);
|
|
|
-
|
|
|
- System.out.println("APPLICATION_NAME = " + APPLICATION_NAME);
|
|
|
- System.out.println("redisKey = " + redisKey);
|
|
|
- System.out.println("smsCode = " + smsCode);
|
|
|
// 判断是否发送验证码
|
|
|
if ("false".equals(SMS_DEBUG) && smsCode == null) throw new CustException("请先发送验证码");
|
|
|
// 判断短信验证码是否错误
|
|
@@ -318,7 +314,6 @@ public class SysAuthServiceImpl implements SysAuthService {
|
|
|
// 判断是否处于登录错误的冻结状态 (2分钟内错误5次,则出现冻结提示)
|
|
|
lockStatusUtil.checkLockStatus(APPLICATION_NAME + "-register-error", username);
|
|
|
lockStatusUtil.checkLockStatus(APPLICATION_NAME + "-register-error", phone);
|
|
|
-
|
|
|
// 判断图形验证码是否正确
|
|
|
if (!captchaUtil.isCaptchaValid(captcha, httpRequestUtil.getKaptchaKey())) {
|
|
|
loginFail("验证码错误", username, false);
|
|
@@ -330,7 +325,7 @@ public class SysAuthServiceImpl implements SysAuthService {
|
|
|
if (sysUser1 != null) throw new CustException("用户名 (" + username + ") 已被注册");
|
|
|
|
|
|
// 判断短信验证码是否正确
|
|
|
- String redisKey = APPLICATION_NAME + "-sms-login" + "-" + phone;
|
|
|
+ String redisKey = APPLICATION_NAME + "-sms-register" + "-" + phone;
|
|
|
Integer smsCode = redisUtil.getCacheObject(redisKey);
|
|
|
// 判断是否发送验证码
|
|
|
if ("false".equals(SMS_DEBUG) && smsCode == null) throw new CustException("请先发送验证码");
|
|
@@ -357,8 +352,15 @@ public class SysAuthServiceImpl implements SysAuthService {
|
|
|
registerEntity.setPhone(sysUserDTO.getPhone());
|
|
|
registerEntity.setPhone_area_code(sysUserDTO.getPhone_area_code());
|
|
|
registerEntity.setPassword(sysUserDTO.getPassword());
|
|
|
- // 注册时,默认使用 游客 2L 权限
|
|
|
- registerEntity.setRole_id(Arrays.asList(2L));
|
|
|
+
|
|
|
+
|
|
|
+ // 做成后台可控制?
|
|
|
+
|
|
|
+ // 注册时,默认使用 权限
|
|
|
+ registerEntity.setRole_id(Arrays.asList(3L));
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
registerEntity.setInvite_code(sysUserDTO.getInvite_code());
|
|
|
// 注册时,状态为禁用
|
|
|
registerEntity.setStatus(-1);
|