Commit 719a1c3d by ddx

real login proxy add log

parent b2bdd03c
...@@ -135,6 +135,10 @@ public class TkRealTokenLog { ...@@ -135,6 +135,10 @@ public class TkRealTokenLog {
private String resContext; private String resContext;
private String loginType;
private String loginTaxno;
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method returns the value of the database column tk_real_token_log.id * This method returns the value of the database column tk_real_token_log.id
...@@ -534,4 +538,20 @@ public class TkRealTokenLog { ...@@ -534,4 +538,20 @@ public class TkRealTokenLog {
public void setResContext(String resContext) { public void setResContext(String resContext) {
this.resContext = resContext; this.resContext = resContext;
} }
public String getLoginType() {
return loginType;
}
public void setLoginType(String loginType) {
this.loginType = loginType;
}
public String getLoginTaxno() {
return loginTaxno;
}
public void setLoginTaxno(String loginTaxno) {
this.loginTaxno = loginTaxno;
}
} }
\ No newline at end of file
...@@ -93,6 +93,8 @@ public class TkToken { ...@@ -93,6 +93,8 @@ public class TkToken {
private String authCode; private String authCode;
private String loginTaxno;
@Override @Override
public String toString() { public String toString() {
return "TkToken{" + return "TkToken{" +
......
...@@ -226,6 +226,12 @@ ...@@ -226,6 +226,12 @@
<if test="resContext != null" > <if test="resContext != null" >
res_context, res_context,
</if> </if>
<if test="loginType != null" >
login_type,
</if>
<if test="loginTaxno != null" >
login_taxno,
</if>
<if test="timeFlag != null" > <if test="timeFlag != null" >
time_flag, time_flag,
</if> </if>
...@@ -279,6 +285,12 @@ ...@@ -279,6 +285,12 @@
<if test="resContext != null" > <if test="resContext != null" >
#{resContext,jdbcType=VARCHAR}, #{resContext,jdbcType=VARCHAR},
</if> </if>
<if test="loginType != null" >
#{loginType,jdbcType=VARCHAR},
</if>
<if test="loginTaxno != null" >
#{loginTaxno,jdbcType=VARCHAR},
</if>
<if test="timeFlag != null" > <if test="timeFlag != null" >
#{timeFlag,jdbcType=VARCHAR}, #{timeFlag,jdbcType=VARCHAR},
</if> </if>
......
...@@ -48,6 +48,8 @@ public class TkRealTokenLogServiceImpl implements TkRealTokenLogService { ...@@ -48,6 +48,8 @@ public class TkRealTokenLogServiceImpl implements TkRealTokenLogService {
tokenLog.setIsValid(token.getCheckType()); tokenLog.setIsValid(token.getCheckType());
tokenLog.setIpServerNo(token.getTarget()); tokenLog.setIpServerNo(token.getTarget());
tokenLog.setKeyCode(token.getSite()); tokenLog.setKeyCode(token.getSite());
tokenLog.setLoginType(token.getLoginType());
tokenLog.setLoginTaxno(token.getLoginTaxno());
if(null==token.getResDate()) { if(null==token.getResDate()) {
tokenLog.setResDate(DateUtils.getDate()); tokenLog.setResDate(DateUtils.getDate());
} else { } else {
......
...@@ -279,6 +279,8 @@ public class TkTokenServiceImpl implements TkTokenService { ...@@ -279,6 +279,8 @@ public class TkTokenServiceImpl implements TkTokenService {
} else { } else {
updFlag = true; updFlag = true;
} }
//target taxno
setTargetTaxnoByLoginInfoJson(uuId, taxUserInfo, taxno, tkToken);
if (updFlag && !functionNo.equals("01")) { if (updFlag && !functionNo.equals("01")) {
TkToken updToken = queryToken(taxno, zoneCode, userCode); TkToken updToken = queryToken(taxno, zoneCode, userCode);
if(null!=updToken) { if(null!=updToken) {
...@@ -326,6 +328,30 @@ public class TkTokenServiceImpl implements TkTokenService { ...@@ -326,6 +328,30 @@ public class TkTokenServiceImpl implements TkTokenService {
return result; return result;
} }
private void setTargetTaxnoByLoginInfoJson(String uuId, Object taxUserInfo, String taxno, TkToken tkToken) {
try {
if(null!=taxUserInfo) {
JSONObject loginInfoJson = JSON.parseObject(JSON.toJSONString(taxUserInfo));
String loginType = "";
String loginTaxno = taxno;
if (loginInfoJson.containsKey("loginType")) {
loginType = loginInfoJson.getString("loginType");
}
if (StringUtil.isNotEmpty(loginType) && "d".equals(loginType)) {
if (loginInfoJson.containsKey("targetTaxno") && StringUtil.isNotEmpty(loginInfoJson.getString("targetTaxno"))) {
taxno = loginInfoJson.getString("targetTaxno");
}
}
tkToken.setTaxno(taxno);
tkToken.setLoginType(loginType);
tkToken.setLoginTaxno(loginTaxno);
logger.info(uuId + " getRealCookie loginType is " + loginType + ",loginTaxno is " + loginTaxno + "-->>targetTaxno is " + taxno);
}
} catch (Exception e) {
logger.error(uuId + " getRealCookie parse target taxno " + taxno + " is error " + e.getMessage());
}
}
public boolean updateTokenFrom(String uuId, CookieReq cookieReq, JsonResult<String> jsonResult) { public boolean updateTokenFrom(String uuId, CookieReq cookieReq, JsonResult<String> jsonResult) {
boolean isEle = false; boolean isEle = false;
String userCode = cookieReq.getAccessKeyID(); String userCode = cookieReq.getAccessKeyID();
......
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