Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
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
haoban3.0
haoban-manage3.0
Commits
ddb403b4
Commit
ddb403b4
authored
Feb 26, 2020
by
蘑菇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix json
parent
f321b969
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
AuthRequestUtil.java
.../java/com/gic/haoban/manage/web/auth/AuthRequestUtil.java
+10
-3
No files found.
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/auth/AuthRequestUtil.java
View file @
ddb403b4
package
com
.
gic
.
haoban
.
manage
.
web
.
auth
;
import
com.alibaba.fastjson.JSON
;
import
com.gic.haoban.manage.web.vo.LoginVO
;
import
com.gic.redis.data.util.RedisUtil
;
import
org.apache.commons.beanutils.BeanUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -27,12 +29,17 @@ public class AuthRequestUtil {
public
static
final
String
REDIS_FAKE_LOGIN_FLAG_PREFIX
=
"GIC:HAOBAN:HAOBAN_MOBILE_APP:FAKE_LOGIN_TOKEN:"
;
public
static
String
LOGIN_SESSION_KEY
=
"HAOBAN:LOGINUSER"
;
public
static
Object
getSessionUser
()
{
return
getSession
().
getAttribute
(
LOGIN_SESSION_KEY
);
public
static
LoginVO
getSessionUser
()
{
String
json
=
(
String
)
getSession
().
getAttribute
(
LOGIN_SESSION_KEY
);
if
(
StringUtils
.
isBlank
(
json
)){
return
null
;
}
return
JSON
.
parseObject
(
json
,
LoginVO
.
class
);
}
public
static
void
setSessionUser
(
Object
obj
)
{
getSession
().
setAttribute
(
LOGIN_SESSION_KEY
,
obj
);
String
userJson
=
JSON
.
toJSONString
(
obj
);
getSession
().
setAttribute
(
LOGIN_SESSION_KEY
,
userJson
);
}
public
static
void
delSessionUser
()
{
...
...
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