|
@@ -1,6 +1,6 @@
|
|
|
package com.haha.service;
|
|
package com.haha.service;
|
|
|
|
|
|
|
|
-import com.haha.common.vo.RedisConstants;
|
|
|
|
|
|
|
+import com.haha.common.RedisConstants;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@@ -22,15 +22,15 @@ public class RedisService {
|
|
|
*/
|
|
*/
|
|
|
public void setSaTokenInfo(String token, String loginId, long timeout) {
|
|
public void setSaTokenInfo(String token, String loginId, long timeout) {
|
|
|
stringRedisTemplate.opsForValue().set(
|
|
stringRedisTemplate.opsForValue().set(
|
|
|
- String.format(RedisConstants.SA_TOKEN_USER_TOKEN_KEY, token),
|
|
|
|
|
- loginId,
|
|
|
|
|
- timeout,
|
|
|
|
|
|
|
+ String.format(RedisConstants.SA_TOKEN_USER_TOKEN_KEY, token),
|
|
|
|
|
+ loginId,
|
|
|
|
|
+ timeout,
|
|
|
TimeUnit.SECONDS
|
|
TimeUnit.SECONDS
|
|
|
);
|
|
);
|
|
|
stringRedisTemplate.opsForValue().set(
|
|
stringRedisTemplate.opsForValue().set(
|
|
|
- String.format(RedisConstants.SA_TOKEN_USER_LOGIN_ID_KEY, loginId),
|
|
|
|
|
- token,
|
|
|
|
|
- timeout,
|
|
|
|
|
|
|
+ String.format(RedisConstants.SA_TOKEN_USER_LOGIN_ID_KEY, loginId),
|
|
|
|
|
+ token,
|
|
|
|
|
+ timeout,
|
|
|
TimeUnit.SECONDS
|
|
TimeUnit.SECONDS
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|