Commit cf91a27d authored by xiaoguang.xu's avatar xiaoguang.xu

每个渠道都有不同的 session

parent 13314419
...@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment