|
|
@@ -1,12 +1,11 @@
|
|
|
package com.sckw.core.filter;
|
|
|
|
|
|
-import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
-import com.sckw.core.web.config.CustomConfig;
|
|
|
import com.sckw.core.exception.SystemException;
|
|
|
import com.sckw.core.model.constant.Global;
|
|
|
import com.sckw.core.utils.EncryUtil;
|
|
|
import com.sckw.core.utils.StringUtils;
|
|
|
+import com.sckw.core.web.config.CustomConfig;
|
|
|
import com.sckw.core.web.constant.HttpStatus;
|
|
|
import com.sckw.core.web.constant.RequestConstant;
|
|
|
import com.sckw.core.web.context.LoginUserHolder;
|
|
|
@@ -76,7 +75,8 @@ public class LoginFilter implements Filter {
|
|
|
//从redis获取用户信息
|
|
|
String clientType = request.getHeader(RequestConstant.CLIENT_TYPE);
|
|
|
String systemType = request.getHeader(RequestConstant.SYSTEM_TYPE);
|
|
|
- Object object = RedissonUtils.getString(Global.getFullUserLoginKey(Integer.parseInt(systemType), Long.parseLong(key), clientType));
|
|
|
+ String userLoginKey = Global.getFullUserLoginKey(Integer.parseInt(systemType), Long.parseLong(key), clientType);
|
|
|
+ Object object = RedissonUtils.getString(userLoginKey);
|
|
|
if (Objects.isNull(object)) {
|
|
|
throw new SystemException(HttpStatus.PARAMETERS_MISSING_CODE, HttpStatus.TOKEN_INVAILD);
|
|
|
}
|
|
|
@@ -93,7 +93,7 @@ public class LoginFilter implements Filter {
|
|
|
throw new SystemException(HttpStatus.AUTHORITY_NO_CODE, HttpStatus.ACCESS_FIAL);
|
|
|
}
|
|
|
|
|
|
- RedissonUtils.putString(Global.getFullUserLoginKey(Integer.parseInt(systemType), Long.parseLong(key), clientType), JSON.toJSONString(object), Global.PC_TOKEN_EXPIRE);
|
|
|
+ RedissonUtils.putString(userLoginKey, object.toString(), Global.PC_TOKEN_EXPIRE);
|
|
|
LoginUserHolder.set(loginUserInfo);
|
|
|
filterChain.doFilter(servletRequest, servletResponse);
|
|
|
LoginUserHolder.remove();
|