From 667ed6f3c7eecbc881a84d4ed253828d615da284 Mon Sep 17 00:00:00 2001 From: hutongqing <hutongqing@hnkhzn.com> Date: 星期六, 12 十月 2024 11:56:21 +0800 Subject: [PATCH] 单点登录 --- WIDESEAWCS_Server/WIDESEAWCS_SystemServices/Sys_UserService.cs | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/Sys_UserService.cs b/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/Sys_UserService.cs index 85d5afa..874ff8f 100644 --- a/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/Sys_UserService.cs +++ b/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/Sys_UserService.cs @@ -10,15 +10,18 @@ using WIDESEAWCS_ISystemRepository; using WIDESEAWCS_Core.BaseRepository; using System.Net; +using WIDESEAWCS_Core.Caches; namespace WIDESEAWCS_SystemServices { public class Sys_UserService : ServiceBase<Sys_User, ISys_UserRepository>, ISys_UserService { private readonly IUnitOfWorkManage _unitOfWorkManage; - public Sys_UserService(ISys_UserRepository repository, IUnitOfWorkManage unitOfWorkManage) : base(repository) + private readonly ICacheService _cacheService; + public Sys_UserService(ISys_UserRepository repository, IUnitOfWorkManage unitOfWorkManage, ICacheService cacheService) : base(repository) { _unitOfWorkManage = unitOfWorkManage; + _cacheService = cacheService; } public WebResponseContent Login(LoginInfo loginInfo) @@ -52,6 +55,8 @@ TenantId = user.TenantId, }); + _cacheService.AddOrUpdate(user.UserId.ToString(), token); + content = WebResponseContent.Instance.OK(data: new { token, userName = user.UserTrueName, img = user.HeadImageUrl }); } else -- Gitblit v1.9.3