From 7ccbd7f6fc245ee6a8704140ae7ad09e2509e6c4 Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期五, 27 九月 2024 09:46:06 +0800
Subject: [PATCH] redis服务移动到base下,实现超时过期用户减去一个在线用户数

---
 Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/redis/RedisConfig.java                           |    2 
 Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/redis/RedisService.java                          |   38 ++++++++----
 Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/constant/VConstant.java                          |    5 +
 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmSessionForLoginImpl.java       |    2 
 Source/plt-web/plt-web-parent/plt-web/pom.xml                                                                                 |   17 -----
 Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/interceptor/VciSecurityInterceptor.java          |   16 +++-
 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/LoginServiceImpl.java                            |   16 ++---
 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmHMSysModConfigServiceImpl.java |   12 +---
 Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/interceptor/VciLogAfterInterceptor.java          |    2 
 Source/plt-web/plt-web-parent/plt-web-base/pom.xml                                                                            |   17 +++++
 Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/redis/FastJson2JsonRedisSerializer.java          |    2 
 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIManagerServiceImpl.java                        |    2 
 Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/PLTabButtonVO.java                                  |    4 
 13 files changed, 74 insertions(+), 61 deletions(-)

diff --git a/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/PLTabButtonVO.java b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/PLTabButtonVO.java
index 8480dbe..9e69eaa 100644
--- a/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/PLTabButtonVO.java
+++ b/Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/PLTabButtonVO.java
@@ -76,7 +76,7 @@
     private List<PLTabButtonVO> children;
 
     /**
-     * 鏄惁鏄剧ず
+     * 鏄剧ず鏂瑰紡
      */
     private String displayMode;
 
@@ -91,7 +91,7 @@
     private String authorization;
 
     /**
-     * 鏄剧ず鏂瑰紡
+     * 鏄惁鏄剧ず
      */
     private String show;
 
diff --git a/Source/plt-web/plt-web-parent/plt-web-base/pom.xml b/Source/plt-web/plt-web-parent/plt-web-base/pom.xml
index f07c7fa..880a7ba 100644
--- a/Source/plt-web/plt-web-parent/plt-web-base/pom.xml
+++ b/Source/plt-web/plt-web-parent/plt-web-base/pom.xml
@@ -73,6 +73,23 @@
             <artifactId>icegridgui</artifactId>
             <version>1.0.RELEASE</version>
         </dependency>
+        <!--redis start-->
+        <dependency>
+            <groupId>org.springframework.data</groupId>
+            <artifactId>spring-data-redis</artifactId>
+            <version>2.1.5.RELEASE</version>
+        </dependency>
+        <dependency>
+            <groupId>redis.clients</groupId>
+            <artifactId>jedis</artifactId>
+            <version>2.9.0</version>
+        </dependency>
+        <!--redis end-->
+        <dependency>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-core</artifactId>
+            <version>2.13.3</version>
+        </dependency>
     </dependencies>
 
 </project>
\ No newline at end of file
diff --git a/Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/constant/VConstant.java b/Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/constant/VConstant.java
index e9c2ddd..5dff82d 100644
--- a/Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/constant/VConstant.java
+++ b/Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/constant/VConstant.java
@@ -82,6 +82,11 @@
     public static final String SYS_ENUM_KEY = "sys_enum:";
 
     /**
+     * 褰撳墠鐧诲綍鐨勭敤鎴锋�绘暟cache key
+     */
+    public static final String CURRENT_LOGGED_USERS_KEY = "current_logged_users";
+
+    /**
      * 璧勬簮鏄犲皠璺緞 鍓嶇紑
      */
     public static final String RESOURCE_PREFIX = "/profile";
diff --git a/Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/interceptor/VciLogAfterInterceptor.java b/Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/interceptor/VciLogAfterInterceptor.java
index 334d0a2..cbde7da 100644
--- a/Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/interceptor/VciLogAfterInterceptor.java
+++ b/Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/interceptor/VciLogAfterInterceptor.java
@@ -1,8 +1,6 @@
 package com.vci.starter.web.interceptor;
 
 import com.vci.starter.web.constant.TokenKeyConstant;
-import com.vci.starter.web.util.VciBaseUtil;
-import com.vci.starter.web.util.WebThreadLocalUtil;
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.MDC;
 import org.springframework.beans.factory.annotation.Autowired;
diff --git a/Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/interceptor/VciSecurityInterceptor.java b/Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/interceptor/VciSecurityInterceptor.java
index 9679f27..68ef18a 100644
--- a/Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/interceptor/VciSecurityInterceptor.java
+++ b/Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/interceptor/VciSecurityInterceptor.java
@@ -4,9 +4,11 @@
 import com.vci.starter.web.annotation.controller.VciUnCheckRight;
 import com.vci.starter.web.autoconfigure.SpringMVCConfig;
 import com.vci.starter.web.constant.TokenKeyConstant;
+import com.vci.starter.web.constant.VConstant;
 import com.vci.starter.web.enumpck.ResultCodeEnum;
 import com.vci.starter.web.pagemodel.BaseResult;
 import com.vci.starter.web.pagemodel.SessionInfo;
+import com.vci.starter.web.redis.RedisService;
 import com.vci.starter.web.util.ApplicationContextProvider;
 import com.vci.starter.web.util.LangBaseUtil;
 import com.vci.starter.web.util.VciBaseUtil;
@@ -15,15 +17,11 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.AnnotationConfigApplicationContext;
 import org.springframework.context.annotation.Configuration;
-import org.springframework.stereotype.Component;
-import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
 import org.springframework.web.method.HandlerMethod;
 import org.springframework.web.servlet.HandlerInterceptor;
 
-import javax.annotation.Resource;
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -56,6 +54,9 @@
     @Autowired
     private VciSessionForLoginI vciSessionForLoginI;
 
+    @Autowired
+    private RedisService redisService;
+
     /**
      * 鎵ц鎷︽埅
      * @param request 璇锋眰瀵硅薄
@@ -76,7 +77,7 @@
         if(StringUtils.isBlank(userToken)){
             userToken = request.getParameter(TokenKeyConstant.USER_TOKEN_KEY);
         }
-        if(!(handler instanceof  HandlerMethod)){
+        if(!(handler instanceof HandlerMethod)){
             return true;
         }
 
@@ -127,6 +128,11 @@
                 if(logger.isErrorEnabled()) {
                     logger.error("token鍊奸潪娉曪紝鎴栬繃鏈燂紝鎴栬�呯敤鎴峰凡缁忚韪笅绾�," + userToken);
                 }
+                //鍒犻櫎缂撳瓨涓粺璁$殑鐢ㄦ埛淇℃伅
+                if(redisService == null){
+                    redisService = ApplicationContextProvider.getBean(RedisService.class);
+                }
+                redisService.decreOnlineUser(VConstant.CURRENT_LOGGED_USERS_KEY);
                 sendErrorMsg(response,"token鍊奸潪娉曪紝鎴栬繃鏈燂紝鎴栬�呯敤鎴峰凡缁忚韪笅绾�," + userToken,1);
                 return false;
             }else{
diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/redis/FastJson2JsonRedisSerializer.java b/Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/redis/FastJson2JsonRedisSerializer.java
similarity index 97%
rename from Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/redis/FastJson2JsonRedisSerializer.java
rename to Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/redis/FastJson2JsonRedisSerializer.java
index 2112c43..e48ac8a 100644
--- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/redis/FastJson2JsonRedisSerializer.java
+++ b/Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/redis/FastJson2JsonRedisSerializer.java
@@ -1,4 +1,4 @@
-package com.vci.web.redis;
+package com.vci.starter.web.redis;
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.serializer.SerializerFeature;
diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/redis/RedisConfig.java b/Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/redis/RedisConfig.java
similarity index 98%
rename from Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/redis/RedisConfig.java
rename to Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/redis/RedisConfig.java
index 7e64afc..d2375b7 100644
--- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/redis/RedisConfig.java
+++ b/Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/redis/RedisConfig.java
@@ -1,4 +1,4 @@
-package com.vci.web.redis;
+package com.vci.starter.web.redis;
 
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.cache.annotation.CachingConfigurerSupport;
diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/redis/RedisService.java b/Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/redis/RedisService.java
similarity index 91%
rename from Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/redis/RedisService.java
rename to Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/redis/RedisService.java
index 7172e62..b795342 100644
--- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/redis/RedisService.java
+++ b/Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/redis/RedisService.java
@@ -1,4 +1,4 @@
-package com.vci.web.redis;
+package com.vci.starter.web.redis;
 
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -11,6 +11,7 @@
 import org.springframework.data.redis.serializer.RedisSerializer;
 import org.springframework.data.redis.serializer.StringRedisSerializer;
 import org.springframework.stereotype.Component;
+import org.springframework.stereotype.Service;
 
 import java.io.IOException;
 import java.util.*;
@@ -21,10 +22,9 @@
  * @author dangsn
  **/
 @SuppressWarnings(value = { "unchecked", "rawtypes" })
-@Component
+@Service
 @Slf4j
-public class RedisService
-{
+public class RedisService {
     @Autowired(required = false)
     public RedisTemplate redisTemplate;
 
@@ -393,19 +393,33 @@
     /**
      * 鐢ㄦ埛鐧诲綍
      * @param currentLoggedUserKey
-     * @param username
      */
-    public void userLogin(String currentLoggedUserKey,String username) {
-        redisTemplate.opsForSet().add(currentLoggedUserKey, username);
+    public void increOnlineUser(String currentLoggedUserKey) {
+        // 妫�鏌ラ敭鏄惁瀛樺湪
+        if (!redisTemplate.hasKey(currentLoggedUserKey)) {
+            // 濡傛灉閿笉瀛樺湪锛屽垵濮嬪寲涓�0
+            redisTemplate.opsForValue().set(currentLoggedUserKey, 0);
+        }
+        // 鑷鍦ㄧ嚎鐢ㄦ埛鏁�
+        redisTemplate.opsForValue().increment(currentLoggedUserKey);
     }
 
     /**
      * 鐢ㄦ埛鐧诲嚭
      * @param currentLoggedUserKey
-     * @param username
      */
-    public void userLogout(String currentLoggedUserKey,String username) {
-        redisTemplate.opsForSet().remove(currentLoggedUserKey, username);
+    public void decreOnlineUser(String currentLoggedUserKey) {
+        // 妫�鏌ュ綋鍓嶅湪绾跨敤鎴锋暟
+        String currentLoggedUser = (String)redisTemplate.opsForValue().get(currentLoggedUserKey);
+
+        if (currentLoggedUser != null) {
+            Long currentCount = Long.parseLong((String)redisTemplate.opsForValue().get(currentLoggedUserKey));
+            if(currentCount > 0){
+
+            }
+            // 鑷噺鍦ㄧ嚎鐢ㄦ埛鏁�
+            redisTemplate.opsForValue().decrement(currentLoggedUserKey);
+        }
     }
 
     /**
@@ -413,8 +427,8 @@
      * @param currentLoggedUserKey
      * @return
      */
-    public long getCurrentLoggedUserCount(String currentLoggedUserKey) {
-        return redisTemplate.opsForSet().size(currentLoggedUserKey);
+    public long getCurrentOnlineUserCount(String currentLoggedUserKey) {
+        return Long.parseLong(redisTemplate.opsForValue().get(currentLoggedUserKey).toString());
     }
 
     /**
diff --git a/Source/plt-web/plt-web-parent/plt-web/pom.xml b/Source/plt-web/plt-web-parent/plt-web/pom.xml
index 039b4d9..a35b80a 100644
--- a/Source/plt-web/plt-web-parent/plt-web/pom.xml
+++ b/Source/plt-web/plt-web-parent/plt-web/pom.xml
@@ -106,23 +106,6 @@
             <version>0.9.11</version>
         </dependency>
 
-        <!--redis start-->
-        <dependency>
-            <groupId>org.springframework.data</groupId>
-            <artifactId>spring-data-redis</artifactId>
-            <version>2.1.5.RELEASE</version>
-        </dependency>
-        <dependency>
-            <groupId>redis.clients</groupId>
-            <artifactId>jedis</artifactId>
-            <version>2.9.0</version>
-        </dependency>
-        <!--redis end-->
-        <dependency>
-            <groupId>com.fasterxml.jackson.core</groupId>
-            <artifactId>jackson-core</artifactId>
-            <version>2.13.3</version>
-        </dependency>
     </dependencies>
 
     <build>
diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmHMSysModConfigServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmHMSysModConfigServiceImpl.java
index 54c8d31..897ed4a 100644
--- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmHMSysModConfigServiceImpl.java
+++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmHMSysModConfigServiceImpl.java
@@ -12,13 +12,14 @@
 import com.vci.starter.poi.bo.WriteExcelData;
 import com.vci.starter.poi.bo.WriteExcelOption;
 import com.vci.starter.poi.util.ExcelUtil;
+import com.vci.starter.web.constant.VConstant;
 import com.vci.starter.web.exception.VciBaseException;
 import com.vci.starter.web.pagemodel.BaseResult;
 import com.vci.starter.web.pagemodel.SessionInfo;
 import com.vci.starter.web.util.LocalFileUtil;
 import com.vci.starter.web.util.VciBaseUtil;
 import com.vci.starter.web.util.WebThreadLocalUtil;
-import com.vci.web.redis.RedisService;
+import com.vci.starter.web.redis.RedisService;
 import com.vci.web.util.Func;
 import com.vci.web.util.PlatformClientUtil;
 import org.slf4j.Logger;
@@ -62,11 +63,6 @@
 
     @Autowired
     private RedisService redisService;
-
-    /**
-     * 褰撳墠鐧诲綍鐨勭敤鎴锋�绘暟key
-     */
-    private static final String CURRENT_LOGGED_USERS_KEY = "current_logged_users";
 
     /**
      * 鏃ュ織
@@ -609,8 +605,6 @@
         return res;
     }
 
-
-
     /**
      * 妫�鏌ユ槸鍚﹀瓨鍦ㄥ紩鐢ㄥ叧绯�
      * @param ids
@@ -795,7 +789,7 @@
      */
     @Override
     public long getOnlineUsersNum() {
-        long currentLoggedUserCount = redisService.getCurrentLoggedUserCount(CURRENT_LOGGED_USERS_KEY);
+        long currentLoggedUserCount = redisService.getCurrentOnlineUserCount(VConstant.CURRENT_LOGGED_USERS_KEY);
         return currentLoggedUserCount;
     }
 
diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmSessionForLoginImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmSessionForLoginImpl.java
index 8896f69..34f1d9a 100644
--- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmSessionForLoginImpl.java
+++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmSessionForLoginImpl.java
@@ -13,7 +13,7 @@
 import com.vci.starter.web.util.*;
 import com.vci.constant.CacheNameConstant;
 import com.vci.web.properties.WebProperties;
-import com.vci.web.redis.RedisService;
+import com.vci.starter.web.redis.RedisService;
 import com.vci.web.service.WebBoServiceI;
 import com.vci.web.util.PlatformClientUtil;
 import com.vci.web.util.WebUtil;
diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/LoginServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/LoginServiceImpl.java
index eb454b7..bb4ab4f 100644
--- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/LoginServiceImpl.java
+++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/LoginServiceImpl.java
@@ -19,6 +19,7 @@
 import com.vci.starter.web.annotation.bus.VciLoginAfter;
 import com.vci.starter.web.annotation.bus.VciLogoutBefore;
 import com.vci.starter.web.annotation.bus.VciLogoutPlugin;
+import com.vci.starter.web.constant.VConstant;
 import com.vci.starter.web.exception.VciBaseException;
 import com.vci.starter.web.interceptor.VciSessionForLoginI;
 import com.vci.starter.web.pagemodel.RequestClientInfo;
@@ -30,7 +31,7 @@
 import com.vci.constant.CacheNameConstant;
 import com.vci.dto.LoginUserDTO;
 import com.vci.web.properties.WebProperties;
-import com.vci.web.redis.RedisService;
+import com.vci.starter.web.redis.RedisService;
 import com.vci.web.service.LoginServiceI;
 import com.vci.web.util.Func;
 import com.vci.web.util.PlatformClientUtil;
@@ -128,11 +129,6 @@
     private PlatformClientUtil platformClientUtil;
 
     /**
-     * 褰撳墠鐧诲綍鐨勭敤鎴锋�绘暟key
-     */
-    private static final String CURRENT_LOGGED_USERS_KEY = "current_logged_users";
-
-    /**
      * 鎵ц鐧诲綍
      * @param userDTO 鐧诲綍淇℃伅
      * @param clientInfo 璇锋眰鐨勫鎴风鐨勪俊鎭�
@@ -151,7 +147,7 @@
      * @return 鎵ц缁撴灉
      * @throws VciBaseException 鍙傛暟閿欒锛岀敤鎴蜂笉鑳界櫥褰曠瓑浼氭姏鍑哄紓甯�
      */
-    private LoginResultBO login(LoginUserDTO userDTO, RequestClientInfo clientInfo, boolean checkPassword/*鍗曠偣鐧诲綍涓嶉渶瑕佹牎楠屽瘑鐮�*/) throws VciBaseException, PLException {
+    private LoginResultBO login(LoginUserDTO userDTO, RequestClientInfo clientInfo, boolean checkPassword/*鍗曠偣鐧诲綍涓嶉渶瑕佹牎楠屽瘑鐮�*/) throws VciBaseException {
         LoginResultBO loginResult = new LoginResultBO();
         loginResult.setSuccess(false);
 
@@ -172,7 +168,7 @@
             String tokenKey = redisService.getCacheObject(userIdTokenKey);
             redisService.deleteObject(tokenKey);
             redisService.deleteObject(userIdTokenKey);
-            redisService.userLogout(CURRENT_LOGGED_USERS_KEY,userDTO.getUserId());
+            redisService.decreOnlineUser(VConstant.CURRENT_LOGGED_USERS_KEY);
         }
 
         //3.鑾峰彇鐢ㄦ埛鐨勫璞★紙瀵硅薄涓寘鍚鑹查儴闂ㄨ繕鏈夊瘑鐮佺瓥鐣ヤ俊鎭�(褰撳墠鐢ㄦ埛娌¤缃瘑鐮佺瓥鐣ュ氨鏄彇鐨勯粯璁ゅ瘑鐮佺瓥鐣�)锛�
@@ -249,7 +245,7 @@
         //鍒濆鍖栧钩鍙扮殑token
         sessionForLogin.initInvocationInfo(sessionInfo);
         //璁板綍褰撳墠鐧诲綍浜烘暟鐨勬�绘暟
-        redisService.userLogin(CURRENT_LOGGED_USERS_KEY,userDTO.getUserId());
+        redisService.increOnlineUser(VConstant.CURRENT_LOGGED_USERS_KEY);
         //鎷疯礉鐢ㄦ埛鍒版柊鐨剆ession浼氳瘽涓�
         copyUser2SessionInfo(user, sessionInfo, userDTO.getLangCode());
         //鎷疯礉璇锋眰淇℃伅鍒皊ession浼氳瘽涓�
@@ -567,7 +563,7 @@
             });
         }
         //娓呴櫎瀛樺綋鍓嶇櫥褰曠殑鐢ㄦ埛锛堟�绘暟-1锛�
-        redisService.userLogout(CURRENT_LOGGED_USERS_KEY,WebThreadLocalUtil.getCurrentUserSessionInfoInThread().getUserId());
+        redisService.decreOnlineUser(VConstant.CURRENT_LOGGED_USERS_KEY);
         sessionForLogin.logout(userToken);
         if(!CollectionUtils.isEmpty(logoutpluginBeanMap)){
             logoutpluginBeanMap.forEach((k,v) -> {
diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIManagerServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIManagerServiceImpl.java
index 40346aa..da050fc 100644
--- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIManagerServiceImpl.java
+++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIManagerServiceImpl.java
@@ -21,7 +21,7 @@
 import com.vci.starter.web.pagemodel.DataGrid;
 import com.vci.starter.web.pagemodel.SessionInfo;
 import com.vci.starter.web.util.*;
-import com.vci.web.redis.RedisService;
+import com.vci.starter.web.redis.RedisService;
 import com.vci.web.service.OsBtmServiceI;
 import com.vci.web.service.UIManagerServiceI;
 import com.vci.web.util.*;

--
Gitblit v1.9.3