From fe941b73b9496f6cfab1a8957f319f74ea09fe1d Mon Sep 17 00:00:00 2001
From: Huangxiaoqiang-03 <1247017146@qq.com>
Date: 星期一, 04 十一月 2024 17:34:32 +0800
Subject: [PATCH] 1

---
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_UserController.cs |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_UserController.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_UserController.cs"
index fa360fe..47d63c8 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_UserController.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_UserController.cs"
@@ -6,6 +6,7 @@
 using WIDESEA_Core;
 using WIDESEA_Core.Authorization;
 using WIDESEA_Core.BaseController;
+using WIDESEA_Core.Caches;
 using WIDESEA_Core.Const;
 using WIDESEA_Core.Helper;
 using WIDESEA_Core.HttpContextUser;
@@ -21,10 +22,12 @@
     public class Sys_UserController : ApiBaseController<ISys_UserService, Sys_User>
     {
         private readonly IHttpContextAccessor _httpContextAccessor;
+        private readonly ICacheService _cacheService;
 
-        public Sys_UserController(ISys_UserService userService, IHttpContextAccessor httpContextAccessor) : base(userService)
+        public Sys_UserController(ISys_UserService userService, IHttpContextAccessor httpContextAccessor, ICacheService cacheService) : base(userService)
         {
             _httpContextAccessor = httpContextAccessor;
+            _cacheService = cacheService;
         }
 
         [HttpPost, Route("login"), AllowAnonymous]
@@ -32,6 +35,7 @@
         {
             return Json(Service.Login(loginInfo));
         }
+
         [HttpPost, Route("getCurrentUserInfo")]
         public WebResponseContent GetCurrentUser()
         {
@@ -81,6 +85,7 @@
                     UserName = App.User.UserName
                 };
                 string newToken = JwtHelper.IssueJwt(tokenModelJwt);
+                _cacheService.AddOrUpdate(tokenModelJwt.UserId.ToString(), newToken);
                 return responseContent = WebResponseContent.Instance.OK(data: newToken);
             }
             catch (Exception ex)

--
Gitblit v1.9.3