From 51b53373d150e4107a51fcf502d0598b7d82c455 Mon Sep 17 00:00:00 2001
From: liuhaonan <konodioda2333@vip.qq.com>
Date: 星期二, 18 一月 2022 11:08:12 +0800
Subject: [PATCH] 功能完善/回滚数据之后新增的填哥的代码
---
sandu-common/src/main/java/com/sandu/common/redis/UserModel.java | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/sandu-common/src/main/java/com/sandu/common/redis/UserModel.java b/sandu-common/src/main/java/com/sandu/common/redis/UserModel.java
index 8b2e877..b26b20f 100644
--- a/sandu-common/src/main/java/com/sandu/common/redis/UserModel.java
+++ b/sandu-common/src/main/java/com/sandu/common/redis/UserModel.java
@@ -1,14 +1,21 @@
package com.sandu.common.redis;
+import com.sandu.common.security.config.SecurityProperties;
+import com.sandu.common.util.SpringContextHolder;
+
/**
* @author chenjiantian
* @date 2021/7/20 12:00
*/
-public class UserModel extends BasePrefix{
+public class UserModel extends BasePrefix {
@Override
public String getModelName() {
- return "user";
+ String onlineKey = SpringContextHolder.getBean(SecurityProperties.class).getOnlineKey();
+ if (onlineKey == null) {
+ throw new IllegalArgumentException("璇烽厤缃畂nlineKey");
+ }
+ return onlineKey;
}
public UserModel(int expireSeconds, String prefix) {
@@ -17,5 +24,8 @@
public static UserModel User = new UserModel(60, "gl");
+ public static UserModel USER_TOKEN = new UserModel(60 * 60 * 24 * 7, "token");
+ public static UserModel USER_INFO = new UserModel(60 * 60 * 24 * 7, "info");
+
}
--
Gitblit v1.9.3