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