Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
aserver
Project
Project
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
15所TongWeb
aserver
Commits
96ab3341
Commit
96ab3341
authored
Jul 08, 2020
by
李德才
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
防止redis 关闭导致的无法登录
parent
a68ed777
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
IndexController.java
.../java/com/archser/aserver/controller/IndexController.java
+11
-6
No files found.
src/main/java/com/archser/aserver/controller/IndexController.java
View file @
96ab3341
...
...
@@ -249,15 +249,20 @@ public class IndexController extends Controller {
Map
<
String
,
Object
>
columns
=
Db
.
findById
(
"AS_USER"
,
"USERNAME"
,
username
).
getColumns
();
Map
<
Object
,
Object
>
userInfo
=
new
HashMap
<>();
userInfo
.
putAll
(
columns
);
Redis
.
use
().
hmset
(
username
+
"_INFO"
,
userInfo
);
// 设置过期时间
Redis
.
use
().
expire
(
username
,
60
*
60
*
24
);
try
{
Redis
.
use
().
hmset
(
username
+
"_INFO"
,
userInfo
);
// 设置过期时间
Redis
.
use
().
expire
(
username
,
60
*
60
*
24
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
finally
{
this
.
renderJson
(
Ret
.
ok
(
"token"
,
jws
).
set
(
"callback"
,
callback
));
logService
.
saveAsLog
(
"login"
,
username
,
JwtInterceptor
.
getIpAddr
(
getRequest
()),
username
+
"登录"
+
app
+
"成功"
,
app
);
}
/**
* 20200706 lidecai 将用户信息保存到Redis end
*/
this
.
renderJson
(
Ret
.
ok
(
"token"
,
jws
).
set
(
"callback"
,
callback
));
logService
.
saveAsLog
(
"login"
,
username
,
JwtInterceptor
.
getIpAddr
(
getRequest
()),
username
+
"登录"
+
app
+
"成功"
,
app
);
}
catch
(
Exception
e
)
{
log
.
error
(
"生成登录票据失败"
,
e
);
this
.
renderJson
(
Ret
.
fail
(
"msg"
,
"生成登录票据失败"
));
...
...
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