|
|
@@ -160,7 +160,7 @@ public class AdminAuthController {
|
|
|
// SysUserLoginBO userInfo = this.getLoginUserInfo(dto.getMobile());
|
|
|
// RPC调用, 失败抛异常, 成功返回用户信息
|
|
|
SysUserBO userInfo = sysUserService.getUserInfoByPin(dto.getUsername());
|
|
|
- if (userInfo == null || StrUtil.isEmpty(userInfo.getPhoneNo()) || !userInfo.getPhoneNo().equals(dto.getMobile())) {
|
|
|
+ if (userInfo == null || StrUtil.isEmpty(userInfo.getPhoneNo())) {
|
|
|
resultData.setStatus(false);
|
|
|
if (userInfo == null) {
|
|
|
//跳到账号密码登陆页面
|
|
|
@@ -170,24 +170,23 @@ public class AdminAuthController {
|
|
|
//跳到账号密码登陆页面
|
|
|
return ApiResult.data("手机号不存在", resultData).setCode(401);
|
|
|
}
|
|
|
- if (!userInfo.getPhoneNo().equals(dto.getMobile())) {
|
|
|
- return ApiResult.data("手机号错误", resultData).setCode(406);
|
|
|
- }
|
|
|
+// if (!userInfo.getPhoneNo().equals(dto.getMobile())) {
|
|
|
+// return ApiResult.data("手机号错误", resultData).setCode(406);
|
|
|
+// }
|
|
|
}
|
|
|
String smsCode = SmsUtils.getRandomInt(RedisConstant.SMS_CODE_LENGTH);
|
|
|
log.info("smsCode--------->{}", smsCode);
|
|
|
LinkedHashMap<String, String> messages = Maps.newLinkedHashMap();
|
|
|
messages.put("code", smsCode);
|
|
|
- SmsResponse smsResponse = SmsFactory.getSmsBlend().sendMessage(dto.getMobile(), messages);
|
|
|
+ SmsResponse smsResponse = SmsFactory.getSmsBlend().sendMessage(userInfo.getPhoneNo(), messages);
|
|
|
if (smsResponse.isSuccess()) {
|
|
|
- service.set(RedisConstant.SMS_CODE_PREFIX + dto.getMobile(), smsCode, RedisConstant.SMS_CODE_DURATION);
|
|
|
+ service.set(RedisConstant.SMS_CODE_PREFIX + userInfo.getPhoneNo(), smsCode, RedisConstant.SMS_CODE_DURATION);
|
|
|
resultData.setShowPicCode(false);
|
|
|
//返回图形验证码
|
|
|
resultData.setCaptchaVO(null);
|
|
|
return ApiResult.data("发送成功", resultData);
|
|
|
}
|
|
|
return ApiResult.data("发送失败", resultData).setCode(406);
|
|
|
-
|
|
|
}
|
|
|
|
|
|
@SysLog(value = "第三步后台用户手机验证码登录", extension = SysLogAspectExtensionForSysUserSmsCodeLogin.class, queryIPLocation = true)
|
|
|
@@ -195,7 +194,6 @@ public class AdminAuthController {
|
|
|
@UseRateLimit(duration = 600, max = 5, strategy = SmsCodeLoginRateLimitStrategy.class, mark = "smsCodeLogin")
|
|
|
@PostMapping(value = "/auth/smsCodeLogin")
|
|
|
public ApiResult<LoginRespDataVO> smsCodeLogin(@RequestBody SysUserSmsCodeLoginDTO dto) {
|
|
|
-
|
|
|
//限流时redis中的key
|
|
|
String key = RedisConstant.SMS_CODE_LOGIN_REDIS_KEY_PREFIX + "smsCodeLogin:" + dto.getMobile() + ":smsCodeLogin";
|
|
|
LoginRespDataVO resultData = this.getResultData(null, key);
|