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
344af7f1
Commit
344af7f1
authored
Jun 25, 2024
by
ddx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加清除登录异常锁信息
parent
2861c4f0
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
70 additions
and
4 deletions
+70
-4
tax-common/src/main/java/com/yxcheng/token/utils/MD5Util.java
+29
-0
tax-file-face/file-face-web/src/test/java/com/yxcheng/file/web/controller/test/UserManageTest.java
+4
-4
tax-token/token-service/src/main/java/com/tax/token/service/api/TkTokenService.java
+2
-0
tax-token/token-service/src/main/java/com/tax/token/service/impl/TkTokenServiceImpl.java
+23
-0
tax-token/token-web/src/main/java/com/tax/token/web/controller/TokenController.java
+12
-0
No files found.
tax-common/src/main/java/com/yxcheng/token/utils/MD5Util.java
View file @
344af7f1
package
com
.
yxcheng
.
token
.
utils
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yxcheng.token.common.model.TaxUserInfo
;
import
java.security.MessageDigest
;
...
...
@@ -59,4 +61,31 @@ public class MD5Util {
private
static
final
String
hexDigits
[]
=
{
"0"
,
"1"
,
"2"
,
"3"
,
"4"
,
"5"
,
"6"
,
"7"
,
"8"
,
"9"
,
"a"
,
"b"
,
"c"
,
"d"
,
"e"
,
"f"
};
public
static
void
main
(
String
[]
args
)
{
String
userJson
=
"{\"password\":\"Bjjs64130088!!\",\"phone\":\"18611725845\",\"loginType\":\"b\",\"userType\":\"办税员\",\"username\":\"18611725845\"}"
;
JSONObject
loginInfoJson
=
JSON
.
parseObject
(
userJson
);
TaxUserInfo
bean
;
String
loginType
=
""
;
if
(
loginInfoJson
.
containsKey
(
"loginType"
))
{
loginType
=
loginInfoJson
.
getString
(
"loginType"
);
}
if
(
"b"
.
equals
(
loginType
))
{
bean
=
new
TaxUserInfo
();
if
(
loginInfoJson
.
containsKey
(
"password"
))
{
bean
.
setPassword
(
loginInfoJson
.
getString
(
"password"
));
}
if
(
loginInfoJson
.
containsKey
(
"username"
))
{
bean
.
setUsername
(
loginInfoJson
.
getString
(
"username"
));
}
if
(
loginInfoJson
.
containsKey
(
"phone"
))
{
bean
.
setPhone
(
loginInfoJson
.
getString
(
"phone"
));
}
if
(
loginInfoJson
.
containsKey
(
"userType"
))
{
bean
.
setUserType
(
loginInfoJson
.
getString
(
"userType"
));
}
bean
.
setLoginType
(
"b"
);
System
.
out
.
println
(
MD5Util
.
MD5Encode
(
bean
.
toString
()));
}
}
}
tax-file-face/file-face-web/src/test/java/com/yxcheng/file/web/controller/test/UserManageTest.java
View file @
344af7f1
...
...
@@ -12,8 +12,8 @@ import java.util.Map;
public
class
UserManageTest
{
String
accessKeyID
=
"e
dd
"
;
static
String
accessKeySecret
=
"e
dd@01!@#ccd143
"
;
String
accessKeyID
=
"e
changcheng
"
;
static
String
accessKeySecret
=
"e
changcheng#@rrwea2
"
;
static
String
host
=
"https://api.taxservices.cn"
;
...
...
@@ -48,7 +48,7 @@ public class UserManageTest {
String
url
=
host
+
"/invoicefile/taxManage"
;
String
signStr
=
"AccessKeyID=%s&SignatureNonce=%s&TimeStamp=%s&Version=1.0"
;
String
taxno
=
"91
31010469883610
8Q"
;
String
taxno
=
"91
450103MAD4RP0N
8Q"
;
taxno
=
taxno
.
trim
();
String
signatureNonce
=
UUIDGenerator
.
generate
();
long
time
=
System
.
currentTimeMillis
();
...
...
@@ -83,7 +83,7 @@ public class UserManageTest {
param
.
put
(
"functionList"
,
userList
);
System
.
out
.
println
(
JSON
.
toJSONString
(
param
));
String
ret
=
HttpHelper
.
post
WithJson
(
url
,
JSON
.
toJSONString
(
param
)
);
String
ret
=
HttpHelper
.
post
JsonEntity
(
url
,
JSON
.
toJSONString
(
param
)).
getContent
(
);
System
.
out
.
println
(
ret
);
}
...
...
tax-token/token-service/src/main/java/com/tax/token/service/api/TkTokenService.java
View file @
344af7f1
...
...
@@ -58,4 +58,6 @@ public interface TkTokenService {
int
getTokenRealRequestCount
(
String
userCode
,
String
taxno
);
void
setTokenRealRequestCount
(
String
userCode
,
String
taxno
);
JsonResult
<
String
>
cleanLoginLockInfo
(
String
uuId
,
CookieReq
cookieReq
);
}
tax-token/token-service/src/main/java/com/tax/token/service/impl/TkTokenServiceImpl.java
View file @
344af7f1
...
...
@@ -794,6 +794,7 @@ public class TkTokenServiceImpl implements TkTokenService {
tkTokenMapper
.
updateByPrimaryKeySelective
(
updateToken
);
}
public
void
updateTokenErrorInfo
(
String
uuId
,
TkToken
tkToken
)
{
TkToken
updateToken
=
new
TkToken
();
updateToken
.
setTokenStatus
(
tkToken
.
getTokenStatus
());
...
...
@@ -1025,4 +1026,26 @@ public class TkTokenServiceImpl implements TkTokenService {
redisService
.
set
(
RedisContants
.
TOKEN_REALREQUEST_COUNT
+
userCode
+
RedisContants
.
DELIMITER
+
taxno
,
times
,
20
*
60
);
}
public
JsonResult
<
String
>
cleanLoginLockInfo
(
String
uuId
,
CookieReq
cookieReq
)
{
JsonResult
result
=
new
JsonResult
();
String
taxno
=
cookieReq
.
getTaxno
();
try
{
Map
<
String
,
Object
>
resMap
=
CleanCookieUtil
.
cleanCookie
(
uuId
,
cookieReq
,
"10"
);
if
(!
TokenThirdServiceFactory
.
isSuccess
(
resMap
))
{
String
resMessage
=
(
String
)
resMap
.
get
(
"message"
);
if
(
StringUtil
.
isNotEmpty
(
resMessage
))
{
result
.
setMessage
(
resMessage
);
}
else
{
result
.
errorResponse
(
ResultEnum
.
flush_error
);
}
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
result
.
errorResponse
(
ResultEnum
.
flush_error
);
logger
.
error
(
uuId
+
" cleanLoginLockInfo taxno is "
+
taxno
+
" ,send is error!"
+
e
.
getMessage
());
}
logger
.
info
(
uuId
+
" cleanLoginLockInfo taxno is "
+
taxno
+
", result is "
+
result
);
return
result
;
}
}
tax-token/token-web/src/main/java/com/tax/token/web/controller/TokenController.java
View file @
344af7f1
...
...
@@ -220,4 +220,16 @@ public class TokenController extends BaseClientController {
return
tokenService
.
selectTokenListByErrorCode
(
userCode
,
errorCode
,
zoneCode
);
}
@RequestMapping
(
value
={
"/cleanLoginLockInfo"
}
,
method
=
RequestMethod
.
POST
)
@LogT
public
JsonResult
<
String
>
cleanLoginLockInfo
(
@RequestBody
CookieReq
cookieReq
){
CrRpcResult
crRpcResult
=
userClient
.
isSafe
(
cookieReq
);
if
(!
checkUserSafe
(
crRpcResult
)){
return
JsonResult
.
errorResult
(
crRpcResult
.
getCode
(),
crRpcResult
.
getMessage
());
}
cookieReq
.
setUserCode
(
cookieReq
.
getAccessKeyID
());
String
uuId
=
UUIDGenerator
.
generate
();
JsonResult
<
String
>
jsonResult
=
tokenService
.
cleanLoginLockInfo
(
uuId
,
cookieReq
);
return
jsonResult
;
}
}
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