update 企业端无法登陆

This commit is contained in:
lijiarao
2023-08-24 09:53:36 +08:00
parent b49bc36c1a
commit 6ac6da4613
2 changed files with 15 additions and 14 deletions
@@ -3,6 +3,7 @@ package com.jero.config.shiro;
import com.jero.common.constant.enums.LoginType;
import com.jero.common.constant.enums.LoginUserTypeEnum;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authc.AuthenticationInfo;
import org.apache.shiro.authc.AuthenticationToken;
@@ -182,18 +182,18 @@ public class CompanyLoginController {
} catch (Exception e) {
e.printStackTrace();
}
//String captcha = sysLoginModel.getCaptcha();
//if (captcha == null) {
// result.error500("验证码无效");
// return result;
//}
//Object checkCode = redisUtil.get("_verification:_phone:" + phone);
//if (checkCode == null || !Objects.equals(checkCode,captcha)) {
// result.error500("验证码错误");
// return result;
//} else {
// redisUtil.del("_verification:_phone:" + phone);
//}
/*String captcha = sysLoginModel.getCaptcha();
if (captcha == null) {
result.error500("验证码无效");
return result;
}
Object checkCode = redisUtil.get("_verification:_phone:" + phone);
if (checkCode == null || !Objects.equals(checkCode,captcha)) {
result.error500("验证码错误");
return result;
} else {
redisUtil.del("_verification:_phone:" + phone);
}*/
//1. 校验用户是否有效
//update-begin-author:wangshuai date:20200601 for: 登录代码验证用户是否注销bug,if条件永远为false
@@ -384,8 +384,8 @@ public class CompanyLoginController {
// 生成token
String token = JwtUtil.sign(phone, syspassword);
// 设置token缓存有效时间
redisUtil.set(CommonConstant.PREFIX_USER_TOKEN + token, token);
redisUtil.expire(CommonConstant.PREFIX_USER_TOKEN + token, JwtUtil.EXPIRE_TIME * 2 / 1000);
redisUtil.set(CommonConstant.PREFIX_USER_TOKEN + phone, token);
redisUtil.expire(CommonConstant.PREFIX_USER_TOKEN + phone, JwtUtil.EXPIRE_TIME * 2 / 1000);
JSONObject obj = new JSONObject();
obj.put("token", token);