登入生成token的小bug issues/I1XOVS

This commit is contained in:
zhangdaiscott
2020-10-12 15:41:17 +08:00
parent 72f32e47a0
commit b92bec3eed
2 changed files with 7 additions and 2 deletions

View File

@ -1,5 +1,6 @@
package org.jeecg.config.shiro;
import cn.hutool.crypto.SecureUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authc.AuthenticationInfo;
@ -118,6 +119,8 @@ public class ShiroRealm extends AuthorizingRealm {
//如果redis缓存用户信息为空则通过接口获取用户信息,避免超过两个小时操作中token过期
if(loginUser==null){
loginUser = commonAPI.getUserByName(username);
//密码二次加密因为存于redis会泄露
loginUser.setPassword(SecureUtil.md5(loginUser.getPassword()));
}
if (loginUser == null) {
throw new AuthenticationException("用户不存在!");