Commit 4cbee66c by zwb

修改登录验证码去除与登录过期时间

parent aea9d611
...@@ -53,15 +53,17 @@ public class PasswordAuthStrategy implements IAuthStrategy { ...@@ -53,15 +53,17 @@ public class PasswordAuthStrategy implements IAuthStrategy {
String uuid = loginBody.getUuid(); String uuid = loginBody.getUuid();
// 验证码开关 // 验证码开关
if (captchaProperties.getEnabled()) { // if (captchaProperties.getEnabled()) {
validateCaptcha(username, code, uuid); // validateCaptcha(username, code, uuid);
} // }
LoginUser loginUser = remoteUserService.getUserInfo(username); LoginUser loginUser = remoteUserService.getUserInfo(username);
loginService.checkLogin(LoginType.PASSWORD, username, () -> !BCrypt.checkpw(password, loginUser.getPassword())); loginService.checkLogin(LoginType.PASSWORD, username, () -> !BCrypt.checkpw(password, loginUser.getPassword()));
SaLoginModel model = new SaLoginModel(); SaLoginModel model = new SaLoginModel();
model.setTimeout(604800); // 7天有效 // model.setTimeout(604800); // 7天有效
model.setActiveTimeout(1800);// 半小时不活动自动下线 // model.setActiveTimeout(1800);// 半小时不活动自动下线
model.setTimeout(3600L * 24 * 365 * 1); // 1年有效
model.setActiveTimeout(3600L * 24 * 365 * 1);// 1年不活动自动下线
// 生成token // 生成token
LoginHelper.login(loginUser, model); LoginHelper.login(loginUser, model);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment