Merge remote-tracking branch 'origin/master'

qianming 3 years ago
commit b1f0e8ca51

@ -92,7 +92,6 @@ public class TokenFilter implements Filter {
&& !uri.endsWith("/dataSet/testTransform") && !uri.endsWith("/dataSet/testTransform")
&& !uri.endsWith("/reportDashboard/getData") && !uri.endsWith("/reportDashboard/getData")
&& !uri.startsWith("/dict") && !uri.startsWith("/dict")
&& !uri.startsWith("/dict")
) { ) {
//不允许删除 //不允许删除
String method = request.getMethod(); String method = request.getMethod();
@ -115,7 +114,9 @@ public class TokenFilter implements Filter {
Filter.super.destroy(); Filter.super.destroy();
} }
/** /**
*
*
* @param skipUrlList * @param skipUrlList
* @return * @return
*/ */

@ -148,21 +148,20 @@ public class AccessUserServiceImpl implements AccessUserService {
// 3.如果该用户登录未过期,这里允许一个用户在多个终端登录 // 3.如果该用户登录未过期,这里允许一个用户在多个终端登录
String tokenKey = String.format(BusinessConstant.GAEA_SECURITY_LOGIN_TOKEN, loginName); String tokenKey = String.format(BusinessConstant.GAEA_SECURITY_LOGIN_TOKEN, loginName);
String userKey = String.format(BusinessConstant.GAEA_SECURITY_LOGIN_USER, loginName);
String token = ""; String token = "";
GaeaUserDto gaeaUser = new GaeaUserDto(); GaeaUserDto gaeaUser = new GaeaUserDto();
if (cacheHelper.exist(tokenKey) && cacheHelper.exist(userKey)) { if (cacheHelper.exist(tokenKey)) {
token = cacheHelper.stringGet(tokenKey); token = cacheHelper.stringGet(tokenKey);
gaeaUser = JSONObject.parseObject(cacheHelper.stringGet(userKey), GaeaUserDto.class); } else {
return gaeaUser; // 生成用户token
}
// 4.生成用户token
String uuid = GaeaUtils.UUID(); String uuid = GaeaUtils.UUID();
token = jwtBean.createToken(loginName, uuid); token = jwtBean.createToken(loginName, uuid);
cacheHelper.stringSetExpire(tokenKey, token, 3600); cacheHelper.stringSetExpire(tokenKey, token, 3600);
}
// 4.读取用户最新人权限主信息
String userKey = String.format(BusinessConstant.GAEA_SECURITY_LOGIN_USER, loginName);
// 5.缓存用户权限主信息
List<String> authorities = accessUserMapper.queryAuthoritiesByLoginName(loginName); List<String> authorities = accessUserMapper.queryAuthoritiesByLoginName(loginName);
gaeaUser.setLoginName(loginName); gaeaUser.setLoginName(loginName);
gaeaUser.setRealName(accessUser.getRealName()); gaeaUser.setRealName(accessUser.getRealName());

Loading…
Cancel
Save