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
ac8ad2b2
Commit
ac8ad2b2
authored
Aug 05, 2020
by
胡文明
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
78145c41
9cc2def9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
10 deletions
+10
-10
ErrorCodes.java
...va/org/sss/presentation/noui/api/response/ErrorCodes.java
+3
-3
LoginController.java
...org/sss/presentation/noui/controller/LoginController.java
+5
-5
TokenInterceptor.java
.../java/org/sss/presentation/noui/jwt/TokenInterceptor.java
+2
-2
No files found.
src/main/java/org/sss/presentation/noui/api/response/ErrorCodes.java
View file @
ac8ad2b2
...
...
@@ -28,12 +28,12 @@ public class ErrorCodes {
public
static
final
String
UNSUPPORTED_DATA_TYPE
=
"R0016"
;
public
static
final
String
UNKNOEW_TRANS
=
"R0017"
;
public
static
final
String
FORBIDDEN_TRANS
=
"R0018"
;
public
static
final
String
INTERRUPTED_ERROR
=
"R9997"
;
public
static
final
String
REDIS_CONNECTION_ERROR
=
"R9998"
;
public
static
final
String
ERROR
=
"R9999"
;
public
static
final
String
BUSINESS_ERROR
=
"E0001"
;
}
src/main/java/org/sss/presentation/noui/controller/LoginController.java
View file @
ac8ad2b2
...
...
@@ -137,14 +137,14 @@ public class LoginController {
getMenus
(
item
,
subMenuList
);
}
}
@ResponseBody
@RequestMapping
(
value
=
"/logout"
,
method
=
RequestMethod
.
POST
)
public
Object
logout
(
@RequestBody
Map
<
String
,
Object
>
dataMap
,
HttpServletRequest
request
,
HttpSession
session
)
{
return
"ok"
;
}
}
src/main/java/org/sss/presentation/noui/jwt/TokenInterceptor.java
View file @
ac8ad2b2
...
...
@@ -74,7 +74,7 @@ public class TokenInterceptor implements HandlerInterceptor {
}
// 验证登录时间
if
(
System
.
currentTimeMillis
()
>
redisLoginInfo
.
getExpiredTime
())
{
Result
rt
=
new
Result
(
ErrorCodes
.
LOGIN_TIMEOUT
,
"会话超时,请重新登录。超时时间戳:"
+
redisLoginInfo
.
getExpiredTime
()+
",当前时间戳:"
+
System
.
currentTimeMillis
(),
null
);
responseMessage
(
response
,
response
.
getWriter
(),
rt
);
...
...
@@ -82,7 +82,7 @@ public class TokenInterceptor implements HandlerInterceptor {
}
// 重新刷入登陆时间
RedisLoginInfo
nweRedisLoginInfo
=
new
RedisLoginInfo
(
userId
,
token
,
NumericUtil
.
sessionTimeOut
(),
redisLoginInfo
.
getSysmod
(),
terminalType
);
RedisLoginInfo
nweRedisLoginInfo
=
new
RedisLoginInfo
(
userId
,
token
,
NumericUtil
.
sessionTimeOut
(),
redisLoginInfo
.
getSysmod
(),
noUiRequest
.
getTerminalType
()
);
RedisUtil
.
set
(
Constants
.
SESSION
+
"."
+
userId
+
"."
+
terminalType
,
nweRedisLoginInfo
);
return
true
;
...
...
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