Commit 881b4c72 by ddx

增加清除传cookie节点

parent 976a7e6c
...@@ -19,6 +19,7 @@ public class CookieReq extends SafeModel implements MqMessage { ...@@ -19,6 +19,7 @@ public class CookieReq extends SafeModel implements MqMessage {
private String site; private String site;
private String target; private String target;
private Object userInfoJson; private Object userInfoJson;
private Object cookieInfoJson;
@Override @Override
public String toString() { public String toString() {
...@@ -32,6 +33,7 @@ public class CookieReq extends SafeModel implements MqMessage { ...@@ -32,6 +33,7 @@ public class CookieReq extends SafeModel implements MqMessage {
", site='" + site + '\'' + ", site='" + site + '\'' +
", target='" + target + '\'' + ", target='" + target + '\'' +
", userInfoJson=" + userInfoJson + ", userInfoJson=" + userInfoJson +
", cookieInfoJson=" + cookieInfoJson +
'}'; '}';
} }
......
...@@ -936,18 +936,25 @@ public class TkTokenServiceImpl implements TkTokenService { ...@@ -936,18 +936,25 @@ public class TkTokenServiceImpl implements TkTokenService {
} else { } else {
newUserInfo = JSON.parseObject(JSON.toJSONString(cookieReq.getUserInfoJson()), TaxUserInfo.class).toString(); newUserInfo = JSON.parseObject(JSON.toJSONString(cookieReq.getUserInfoJson()), TaxUserInfo.class).toString();
} }
logger.info(uuId + " cleanCookie taxno is " + taxno + ", newUserInfo is " + newUserInfo); logger.info(uuId + " cleanCookie taxno is " + taxno + ", userInfoJson newUserInfo is " + newUserInfo);
} else { }
String oldUserInfo = cookieReq.getUserInfo(); //CookieInfo优先级高于UserInfo
if (StringUtils.isNotEmpty(oldUserInfo)) { if(null != cookieReq.getCookieInfoJson()) {
try { JSONObject cookieInfoJson = JSON.parseObject(JSON.toJSONString(cookieReq.getCookieInfoJson()));
newUserInfo = new String(Base64Util.decode(oldUserInfo), "UTF-8"); if (cookieInfoJson.containsKey("cookie")) {
logger.info(uuId + " cleanCookie taxno is " + taxno + ", newUserInfo is " + newUserInfo); String cookie = cookieInfoJson.getString("cookie");
} catch (UnsupportedEncodingException e) { if(cookie.startsWith(EncryptUtil.FKEY)) {
e.printStackTrace(); String cookieString = EncryptUtil.decryptAesCk(cookie);
logger.error(uuId + " cleanCookie taxno is " + taxno + " parse userInfo is error!" + e.getMessage()); logger.info(uuId + " cleanCookie taxno is " + taxno + ", cookieString is " + cookieString);
JSONObject cookieJson = JSON.parseObject(cookieString);
if (cookieJson.containsKey("session")) {
newUserInfo = cookieJson.getString("session");
}
} else if(cookieInfoJson.containsKey("session")) {
newUserInfo = cookieInfoJson.getString("session");
} }
} }
logger.info(uuId + " cleanCookie taxno is " + taxno + ", cookieInfoJson newUserInfo is " + newUserInfo);
} }
if(StringUtil.isEmpty(newUserInfo)) { if(StringUtil.isEmpty(newUserInfo)) {
result.errorResponse(ResultEnum.param_error); result.errorResponse(ResultEnum.param_error);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment