Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tax-sys-nacos
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
caoxiaohong
tax-sys-nacos
Commits
544357b1
Commit
544357b1
authored
Apr 30, 2025
by
ddx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加删除接口
parent
28047427
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
19 deletions
+40
-19
tax-token/token-common/src/main/java/com/tax/token/model/CookieReq.java
+2
-0
tax-token/token-common/src/main/java/com/tax/token/utils/CleanCookieUtil.java
+2
-0
tax-token/token-service/src/main/java/com/tax/token/service/impl/TkTokenServiceImpl.java
+22
-4
tax-token/token-web/src/test/java/com/yxcheng/token/web/controller/test/TokenUnitTest.java
+14
-15
No files found.
tax-token/token-common/src/main/java/com/tax/token/model/CookieReq.java
View file @
544357b1
...
@@ -15,6 +15,7 @@ public class CookieReq extends SafeModel implements MqMessage {
...
@@ -15,6 +15,7 @@ public class CookieReq extends SafeModel implements MqMessage {
private
String
userCode
;
private
String
userCode
;
private
String
userInfo
;
private
String
userInfo
;
private
String
loginType
;
private
String
loginType
;
private
String
loginName
;
private
String
checkType
;
private
String
checkType
;
private
String
site
;
private
String
site
;
private
String
target
;
private
String
target
;
...
@@ -29,6 +30,7 @@ public class CookieReq extends SafeModel implements MqMessage {
...
@@ -29,6 +30,7 @@ public class CookieReq extends SafeModel implements MqMessage {
", userCode='"
+
userCode
+
'\''
+
", userCode='"
+
userCode
+
'\''
+
", userInfo='"
+
userInfo
+
'\''
+
", userInfo='"
+
userInfo
+
'\''
+
", loginType='"
+
loginType
+
'\''
+
", loginType='"
+
loginType
+
'\''
+
", loginName='"
+
loginName
+
'\''
+
", checkType='"
+
checkType
+
'\''
+
", checkType='"
+
checkType
+
'\''
+
", site='"
+
site
+
'\''
+
", site='"
+
site
+
'\''
+
", target='"
+
target
+
'\''
+
", target='"
+
target
+
'\''
+
...
...
tax-token/token-common/src/main/java/com/tax/token/utils/CleanCookieUtil.java
View file @
544357b1
...
@@ -39,6 +39,8 @@ public class CleanCookieUtil {
...
@@ -39,6 +39,8 @@ public class CleanCookieUtil {
JSONArray
jsonArray
=
new
JSONArray
();
JSONArray
jsonArray
=
new
JSONArray
();
if
(
cleanType
.
equals
(
"3"
))
{
if
(
cleanType
.
equals
(
"3"
))
{
jsonArray
.
add
(
cookieReq
.
getZoneCode
()
+
":"
+
cookieReq
.
getUserInfo
());
jsonArray
.
add
(
cookieReq
.
getZoneCode
()
+
":"
+
cookieReq
.
getUserInfo
());
}
else
if
(
cleanType
.
equals
(
"13"
))
{
jsonArray
.
add
(
cookieReq
.
getLoginName
()
+
":"
+
cookieReq
.
getUserInfo
());
}
else
{
}
else
{
jsonArray
.
add
(
cookieReq
.
getZoneCode
()
+
":"
+
taxno
+
":"
+
cookieReq
.
getUserInfo
());
jsonArray
.
add
(
cookieReq
.
getZoneCode
()
+
":"
+
taxno
+
":"
+
cookieReq
.
getUserInfo
());
}
}
...
...
tax-token/token-service/src/main/java/com/tax/token/service/impl/TkTokenServiceImpl.java
View file @
544357b1
...
@@ -908,6 +908,7 @@ public class TkTokenServiceImpl implements TkTokenService {
...
@@ -908,6 +908,7 @@ public class TkTokenServiceImpl implements TkTokenService {
CleanCookieVo
resMap
=
null
;
CleanCookieVo
resMap
=
null
;
try
{
try
{
String
newUserInfo
=
""
;
String
newUserInfo
=
""
;
String
loginName
=
""
;
if
(
null
!=
cookieReq
.
getCookieInfoJson
())
{
if
(
null
!=
cookieReq
.
getCookieInfoJson
())
{
JSONObject
cookieInfoJson
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
cookieReq
.
getCookieInfoJson
()));
JSONObject
cookieInfoJson
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
cookieReq
.
getCookieInfoJson
()));
if
(
cookieInfoJson
.
containsKey
(
"cookie"
))
{
if
(
cookieInfoJson
.
containsKey
(
"cookie"
))
{
...
@@ -916,11 +917,27 @@ public class TkTokenServiceImpl implements TkTokenService {
...
@@ -916,11 +917,27 @@ public class TkTokenServiceImpl implements TkTokenService {
String
cookieString
=
EncryptUtil
.
decryptAesCk
(
cookie
);
String
cookieString
=
EncryptUtil
.
decryptAesCk
(
cookie
);
logger
.
info
(
uuId
+
" cleanCookie taxno is "
+
taxno
+
", cookieString is "
+
cookieString
);
logger
.
info
(
uuId
+
" cleanCookie taxno is "
+
taxno
+
", cookieString is "
+
cookieString
);
JSONObject
cookieJson
=
JSON
.
parseObject
(
cookieString
);
JSONObject
cookieJson
=
JSON
.
parseObject
(
cookieString
);
if
(
cookieJson
.
containsKey
(
"session"
))
{
if
(
cleanType
.
equals
(
"13"
))
{
newUserInfo
=
cookieJson
.
getString
(
"session"
);
if
(
cookieJson
.
containsKey
(
"session"
)
&&
cookieJson
.
containsKey
(
"userGroupName"
))
{
newUserInfo
=
cookieJson
.
getString
(
"session"
);
loginName
=
cookieJson
.
getString
(
"userGroupName"
);
}
}
else
{
if
(
cookieJson
.
containsKey
(
"session"
))
{
newUserInfo
=
cookieJson
.
getString
(
"session"
);
}
}
}
else
{
if
(
cleanType
.
equals
(
"13"
))
{
if
(
cookieInfoJson
.
containsKey
(
"session"
)
&&
cookieInfoJson
.
containsKey
(
"userGroupName"
))
{
newUserInfo
=
cookieInfoJson
.
getString
(
"session"
);
loginName
=
cookieInfoJson
.
getString
(
"userGroupName"
);
}
}
else
{
if
(
cookieInfoJson
.
containsKey
(
"session"
))
{
newUserInfo
=
cookieInfoJson
.
getString
(
"session"
);
}
}
}
}
else
if
(
cookieInfoJson
.
containsKey
(
"session"
))
{
newUserInfo
=
cookieInfoJson
.
getString
(
"session"
);
}
}
}
}
logger
.
info
(
uuId
+
" cleanCookie taxno is "
+
taxno
+
", cookieInfoJson newUserInfo is "
+
newUserInfo
);
logger
.
info
(
uuId
+
" cleanCookie taxno is "
+
taxno
+
", cookieInfoJson newUserInfo is "
+
newUserInfo
);
...
@@ -930,6 +947,7 @@ public class TkTokenServiceImpl implements TkTokenService {
...
@@ -930,6 +947,7 @@ public class TkTokenServiceImpl implements TkTokenService {
}
else
{
}
else
{
if
(
StringUtil
.
isNotEmpty
(
newUserInfo
))
{
if
(
StringUtil
.
isNotEmpty
(
newUserInfo
))
{
cookieReq
.
setUserInfo
(
MD5Util
.
MD5Encode
(
newUserInfo
));
cookieReq
.
setUserInfo
(
MD5Util
.
MD5Encode
(
newUserInfo
));
cookieReq
.
setLoginName
(
loginName
);
}
}
resMap
=
CleanCookieUtil
.
cleanCookie
(
uuId
,
cookieReq
,
cleanType
);
resMap
=
CleanCookieUtil
.
cleanCookie
(
uuId
,
cookieReq
,
cleanType
);
if
(!(
resMap
!=
null
&&
"0"
.
equals
(
resMap
.
getCode
())))
{
if
(!(
resMap
!=
null
&&
"0"
.
equals
(
resMap
.
getCode
())))
{
...
...
tax-token/token-web/src/test/java/com/yxcheng/token/web/controller/test/TokenUnitTest.java
View file @
544357b1
...
@@ -12,9 +12,9 @@ import java.util.Map;
...
@@ -12,9 +12,9 @@ import java.util.Map;
public
class
TokenUnitTest
{
public
class
TokenUnitTest
{
//
static String host = "http://127.0.0.1:8762";
static
String
host
=
"http://127.0.0.1:8762"
;
// static String host = "https://api.taxservices.cn";
// static String host = "https://api.taxservices.cn";
static
String
host
=
"https://api.xfapiao.com"
;
//
static String host = "https://api.xfapiao.com";
String
accessKeyID
=
"eyongyou"
;
String
accessKeyID
=
"eyongyou"
;
static
String
accessKeySecret
=
"yongyou!@#566ccd"
;
static
String
accessKeySecret
=
"yongyou!@#566ccd"
;
...
@@ -213,7 +213,7 @@ public class TokenUnitTest {
...
@@ -213,7 +213,7 @@ public class TokenUnitTest {
@Test
@Test
public
void
testCleanCookie
()
throws
Exception
{
public
void
testCleanCookie
()
throws
Exception
{
String
url
=
host
+
"/client/clean
Cookie
"
;
String
url
=
host
+
"/client/clean
LoginInfo
"
;
String
signStr
=
"AccessKeyID=%s&SignatureNonce=%s&TimeStamp=%s&Version=1.0"
;
String
signStr
=
"AccessKeyID=%s&SignatureNonce=%s&TimeStamp=%s&Version=1.0"
;
String
signatureNonce
=
UUIDGenerator
.
generate
();
String
signatureNonce
=
UUIDGenerator
.
generate
();
...
@@ -229,23 +229,22 @@ public class TokenUnitTest {
...
@@ -229,23 +229,22 @@ public class TokenUnitTest {
param
.
put
(
"timeStamp"
,
timeStamp
);
param
.
put
(
"timeStamp"
,
timeStamp
);
param
.
put
(
"version"
,
"1.0"
);
param
.
put
(
"version"
,
"1.0"
);
param
.
put
(
"signature"
,
getSign
(
signStr
));
param
.
put
(
"signature"
,
getSign
(
signStr
));
// param.put("taxno","91510100MA65M8928X");
// param.put("zoneCode","5100");
// param.put("userInfo",Base64Util.encode("18782909536[a%b@q]YH111000[a%b@q]18782909536[a%b@q]"));
param
.
put
(
"taxno"
,
"914404003980391901"
);
param
.
put
(
"taxno"
,
"914404003980391901"
);
param
.
put
(
"zoneCode"
,
"4400"
);
param
.
put
(
"zoneCode"
,
"4400"
);
// param.put("userInfo",Base64Util.encode("刘志怡021323[a%b@q]Lzy672672[a%b@q]"));
Map
userparam
=
new
HashMap
<>();
Map
userparam
=
new
HashMap
<>();
//
userparam
.
put
(
"loginType"
,
"b"
);
// userparam.put("loginType","b");
userparam
.
put
(
"nsrsbh"
,
"91440101MA5CRHH33W"
);
// userparam.put("nsrsbh","91440101MA5CRHH33W");
userparam
.
put
(
"username"
,
"Fanny123456"
);
// userparam.put("username","Fanny123456");
userparam
.
put
(
"userType"
,
"办税人"
);
// userparam.put("userType","办税人");
userparam
.
put
(
"password"
,
"Fanny123456"
);
// userparam.put("password","Fanny123456");
//
param
.
put
(
"userInfoJson"
,
userparam
);
// param.put("userInfoJson",userparam);
userparam
.
put
(
"cookie"
,
"T1C2K3y8C5PrmwN0+VGXnyf6d3pybZUulkIQ7dqhrOR0SypQS3MPYL2L+iB8DSE6c4ddIFSj8GDgjvZMJHSuE3K5ufDA1wBcHyGb/nUpbfN4MNfyItV60jVsyj1BbqgR+41BiAJRtF7JrXBGo42al0FO951dfSsDiy2jgE0HvIeMJG54KaDlyjGjSlDzAc+gfYex4AESzsQIMCLtMhGfM04LCPxUbB2mWy5d7jDL0ozvqjK64qk/wMAAPsbcdkGdXrfn6m4dGib/646uuv2LoxKL7u9bvjiZ3TVxhyjYoUEpYSVDwGia4lfqawHNlXP5AejN/LqEpfZEFhvlm18p4+XRJNKAMsXcgWsrLuPhsKDBT2jCMzWf3Z7Lk0MHrPjhJIfllgn6jDo8P4XQCgSaDpX2Cbte8eZ69+7c6hywR4H2RBy1BYTISUlZ8jYnuhthDuueuoX+FvB0X8scX+PqS2XPPctkYiAMFR6tv2nU2LQMcx6i2D+mz4lfPi2ThiVVCVRoLAD06GI2ApKp0JJD0hYTfGjg=="
);
param
.
put
(
"cookieInfoJson"
,
userparam
);
System
.
out
.
println
(
url
);
System
.
out
.
println
(
url
);
String
ret
=
HttpHelper
.
postWithJson
(
url
,
JSON
.
toJSONString
(
param
));
String
ret
=
HttpHelper
.
postWithJson
(
url
,
JSON
.
toJSONString
(
param
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment