fix: 登录被注释掉的代码恢复
This commit is contained in:
+9
-10
@@ -113,9 +113,8 @@ public class LoginServiceImpl implements ILoginService {
|
||||
//redisUtil.del(realKey);
|
||||
try {
|
||||
//解密获取密码和用户名
|
||||
// password = CommonUtils.decryptBtRsaPriKey(password, rsaPrivateKey);
|
||||
password = "ABcd13@!";
|
||||
username = "075376";
|
||||
password = CommonUtils.decryptBtRsaPriKey(password, rsaPrivateKey);
|
||||
username = CommonUtils.decryptBtRsaPriKey(username, rsaPrivateKey);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -142,13 +141,13 @@ public class LoginServiceImpl implements ILoginService {
|
||||
//2. 校验用户名或密码是否正确
|
||||
String userpassword = PasswordUtil.encrypt(username, password, sysUser.getSalt());
|
||||
String syspassword = sysUser.getPassword();
|
||||
// if (!syspassword.equals(userpassword)) {
|
||||
// // 重试登录次数加一
|
||||
// retryCount++;
|
||||
// this.setRetryInfoToRedis(username, retryCount);
|
||||
// String msg = retryCount == RETRY_LOGIN_MAX_COUNT ? "密码错误次数过多,请稍后重试":"用户名或密码错误,剩余可登录次数:"+(RETRY_LOGIN_MAX_COUNT - retryCount);
|
||||
// return Result.error(msg);
|
||||
// }
|
||||
if (!syspassword.equals(userpassword)) {
|
||||
// 重试登录次数加一
|
||||
retryCount++;
|
||||
this.setRetryInfoToRedis(username, retryCount);
|
||||
String msg = retryCount == RETRY_LOGIN_MAX_COUNT ? "密码错误次数过多,请稍后重试":"用户名或密码错误,剩余可登录次数:"+(RETRY_LOGIN_MAX_COUNT - retryCount);
|
||||
return Result.error(msg);
|
||||
}
|
||||
//登录成功,清除错误登录次数
|
||||
redisUtil.del(RETRY_LOGIN_PREFIX + username);
|
||||
if (checkSysPermission(username)) {
|
||||
|
||||
Reference in New Issue
Block a user