Browse Source

修复小bug

xiaochan 10 months ago
parent
commit
7652bfc1ad

+ 0 - 1
src/main/java/thyyxxk/webserver/service/redislike/RedisLikeService.java

@@ -339,7 +339,6 @@ public class RedisLikeService {
         dbUserInfo.setSid(us.getSid());
         dbUserInfo.setToken(us.getToken());
         dbUserInfo.setAvatar(us.getAvatar());
-        dbUserInfo.setUserConfig(us.getUserConfig());
         redisServer.setData(key, dbUserInfo);
     }
 

+ 5 - 1
src/main/java/thyyxxk/webserver/service/settings/SettingsService.java

@@ -27,6 +27,7 @@ import thyyxxk.webserver.entity.settings.users.WorkIntegrationPlatformAdvice;
 import thyyxxk.webserver.entity.socketmessage.ApiMessageBody;
 import thyyxxk.webserver.entity.socketmessage.SendUserList;
 import thyyxxk.webserver.service.PublicServer;
+import thyyxxk.webserver.service.RedisServer;
 import thyyxxk.webserver.service.externalhttp.CorpWxSrvc;
 import thyyxxk.webserver.service.externalhttp.WebSocketService;
 import thyyxxk.webserver.service.redislike.RedisLikeService;
@@ -50,17 +51,19 @@ public class SettingsService {
     private final PublicServer publicServer;
     private final RedisLikeService redis;
     private final WebSocketService socketService;
+    private final RedisServer redisServer;
 
     @Value("${is-prod}")
     private boolean isProd;
 
     @Autowired
-    public SettingsService(SettingsDao dao, CorpWxSrvc srvc, PublicServer publicServer, RedisLikeService redis, WebSocketService socketService) {
+    public SettingsService(SettingsDao dao, CorpWxSrvc srvc, PublicServer publicServer, RedisLikeService redis, WebSocketService socketService, RedisServer redisServer) {
         this.dao = dao;
         this.srvc = srvc;
         this.publicServer = publicServer;
         this.redis = redis;
         this.socketService = socketService;
+        this.redisServer = redisServer;
     }
 
     public ResultVo<UserInfo> getUserInfo() {
@@ -401,6 +404,7 @@ public class SettingsService {
 
     public void setUserConfig(String js) {
         dao.updateUserConfig(js, TokenUtil.getInstance().getTokenUserId());
+        redis.updateUserInfo(TokenUtil.getInstance().getTokenUserId());
     }