Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nouiWithSpringMVC
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gechengyang
nouiWithSpringMVC
Commits
0b420f5a
Commit
0b420f5a
authored
Nov 13, 2020
by
WeiCong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复由于redis用户信息丢失导致的资源访问失败问题
parent
854fc17d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 deletions
+8
-9
OpenTransInterceptor.java
...a/org/sss/presentation/noui/jwt/OpenTransInterceptor.java
+8
-9
No files found.
src/main/java/org/sss/presentation/noui/jwt/OpenTransInterceptor.java
View file @
0b420f5a
...
@@ -43,33 +43,32 @@ public class OpenTransInterceptor implements HandlerInterceptor {
...
@@ -43,33 +43,32 @@ public class OpenTransInterceptor implements HandlerInterceptor {
String
terminalType
=
noUiRequest
.
getTerminalType
();
// APP WEB
String
terminalType
=
noUiRequest
.
getTerminalType
();
// APP WEB
RedisLoginInfo
redisLoginInfo
=
null
;
RedisLoginInfo
redisLoginInfo
=
null
;
if
(
!
StringUtils
.
isEmpty
(
noUiRequest
.
getUserId
()))
//开放模式下
if
(
!
StringUtils
.
isEmpty
(
noUiRequest
.
getUserId
()))
//开放模式下
redisLoginInfo
=
(
RedisLoginInfo
)
RedisUtil
.
get
(
StringUtil
.
userUniqueId
(
noUiRequest
));
redisLoginInfo
=
(
RedisLoginInfo
)
RedisUtil
.
get
(
StringUtil
.
userUniqueId
(
noUiRequest
));
//如果是已登录状态,要刷新超时时间
//如果是已登录状态,要刷新超时时间
if
(
redisLoginInfo
!=
null
&&
System
.
currentTimeMillis
()
<=
redisLoginInfo
.
getExpiredTime
())
{
if
(
redisLoginInfo
!=
null
&&
System
.
currentTimeMillis
()
<=
redisLoginInfo
.
getExpiredTime
())
{
// 重新刷入登陆时间
// 重新刷入登陆时间
RedisLoginInfo
nweRedisLoginInfo
=
new
RedisLoginInfo
(
userId
,
token
,
NumericUtil
.
sessionTimeOut
(),
redisLoginInfo
.
getSysmod
(),
noUiRequest
.
getTerminalType
());
RedisLoginInfo
nweRedisLoginInfo
=
new
RedisLoginInfo
(
userId
,
token
,
NumericUtil
.
sessionTimeOut
(),
redisLoginInfo
.
getSysmod
(),
noUiRequest
.
getTerminalType
());
RedisUtil
.
set
(
Constants
.
SESSION
+
"."
+
userId
+
"."
+
terminalType
,
nweRedisLoginInfo
);
RedisUtil
.
set
(
Constants
.
SESSION
+
"."
+
userId
+
"."
+
terminalType
,
nweRedisLoginInfo
);
RedisUtil
.
set
(
StringUtil
.
getCacheSessionId
(
userId
),
request
.
getSession
().
getId
());
}
}
String
url
=
request
.
getRequestURI
();
String
url
=
request
.
getRequestURI
();
String
trnnam
=
null
;
String
trnnam
=
null
;
int
idx1
=
url
.
indexOf
(
NoUiContextManager
.
openSourcePrefix
);
int
idx1
=
url
.
indexOf
(
NoUiContextManager
.
openSourcePrefix
);
int
begpos
=
idx1
+
NoUiContextManager
.
openSourcePrefix
.
length
()+
1
;
int
begpos
=
idx1
+
NoUiContextManager
.
openSourcePrefix
.
length
()
+
1
;
int
idx2
=
url
.
indexOf
(
"/"
,
begpos
);
int
idx2
=
url
.
indexOf
(
"/"
,
begpos
);
if
(
idx2
>
0
)
if
(
idx2
>
0
)
trnnam
=
url
.
substring
(
begpos
,
idx2
);
trnnam
=
url
.
substring
(
begpos
,
idx2
);
if
(
trnnam
==
null
)
if
(
trnnam
==
null
)
{
{
Result
rt
=
new
Result
(
ErrorCodes
.
UNKNOEW_TRANS
,
"未知的交易"
,
null
,
noUiVersion
.
getVersion
());
Result
rt
=
new
Result
(
ErrorCodes
.
UNKNOEW_TRANS
,
"未知的交易"
,
null
,
noUiVersion
.
getVersion
());
responseMessage
(
response
,
response
.
getWriter
(),
rt
);
responseMessage
(
response
,
response
.
getWriter
(),
rt
);
return
false
;
return
false
;
}
}
//交易必须是配置允许开放的交易
//交易必须是配置允许开放的交易
log
.
debug
(
"开放访问交易名:"
+
trnnam
);
log
.
debug
(
"开放访问交易名:"
+
trnnam
);
if
(!
NoUiContextManager
.
openTransactions
.
contains
(
trnnam
))
if
(!
NoUiContextManager
.
openTransactions
.
contains
(
trnnam
))
{
{
Result
rt
=
new
Result
(
ErrorCodes
.
FORBIDDEN_TRANS
,
"非法访问"
,
null
,
noUiVersion
.
getVersion
());
Result
rt
=
new
Result
(
ErrorCodes
.
FORBIDDEN_TRANS
,
"非法访问"
,
null
,
noUiVersion
.
getVersion
());
responseMessage
(
response
,
response
.
getWriter
(),
rt
);
responseMessage
(
response
,
response
.
getWriter
(),
rt
);
return
false
;
return
false
;
...
...
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