Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xyqb-user2
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
head_group
xyqb-user2
Commits
cf91a27d
Commit
cf91a27d
authored
Sep 26, 2019
by
xiaoguang.xu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
每个渠道都有不同的 session
parent
13314419
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
SessionServiceImpl.java
...ntgroup/xyqb/service/session/impl/SessionServiceImpl.java
+7
-5
No files found.
src/main/java/cn/quantgroup/xyqb/service/session/impl/SessionServiceImpl.java
View file @
cf91a27d
...
@@ -99,12 +99,14 @@ public class SessionServiceImpl implements ISessionService {
...
@@ -99,12 +99,14 @@ public class SessionServiceImpl implements ISessionService {
return
stringRedisTemplate
.
opsForValue
().
get
(
generateLoginPropertiesKey
(
userId
,
properties
));
return
stringRedisTemplate
.
opsForValue
().
get
(
generateLoginPropertiesKey
(
userId
,
properties
));
}
}
/**
* 每个渠道都有不同的 session
* @param userId 用户 ID
* @param properties baitiao/xyqb/vcc ... + 用户注册来源
* @return redisKey. 用来标识这个渠道的用户 Session 是否存在
*/
private
String
generateLoginPropertiesKey
(
Long
userId
,
LoginProperties
properties
)
{
private
String
generateLoginPropertiesKey
(
Long
userId
,
LoginProperties
properties
)
{
if
(
"baitiao"
.
equals
(
properties
.
getMerchantName
()))
{
return
Constants
.
Session
.
USER_SESSION_ID_CACHE
+
":"
+
userId
+
":"
+
properties
.
getMerchantName
()
+
":"
+
properties
.
getCreatedFrom
();
return
Constants
.
Session
.
USER_SESSION_ID_CACHE
+
":"
+
String
.
valueOf
(
userId
)
+
":"
+
properties
.
getMerchantName
()
+
":"
+
properties
.
getCreatedFrom
();
}
else
{
return
Constants
.
Session
.
USER_SESSION_ID_CACHE
+
":"
+
String
.
valueOf
(
userId
)
+
":"
+
properties
.
getMerchantName
();
}
}
}
private
String
findSessionValueBySessionId
(
String
sessionId
)
{
private
String
findSessionValueBySessionId
(
String
sessionId
)
{
...
...
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