From ea9bdf217e8202a5fa475262dba1792decb05bcb Mon Sep 17 00:00:00 2001 From: hutongqing <hutongqing@hnkhzn.com> Date: 星期五, 13 九月 2024 15:36:00 +0800 Subject: [PATCH] 1 --- 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_UserController.cs | 6 +++++- 1 files changed, 5 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..ed443cd 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] @@ -81,6 +84,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