From d8eb7acf2e84b8cf7d04a2c830a5573d1e42c546 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Thu, 23 Jan 2025 16:53:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=99=BB=E5=BD=95=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E8=87=AA=E5=8A=A8=E9=80=80=E5=87=BA=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Management/UserService.cs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Management/UserService.cs b/IRaCIS.Core.Application/Service/Management/UserService.cs index 03ccf893c..4b67901d9 100644 --- a/IRaCIS.Core.Application/Service/Management/UserService.cs +++ b/IRaCIS.Core.Application/Service/Management/UserService.cs @@ -1160,18 +1160,17 @@ namespace IRaCIS.Core.Application.Service } } - else - { - await _fusionCache.SetAsync(CacheKeys.UserToken(identityUserId), userLoginReturnModel.JWTStr, TimeSpan.FromDays(7)); - await _fusionCache.SetAsync(CacheKeys.UserAutoLoginOut(identityUserId), DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), TimeSpan.FromMinutes(_verifyConfig.CurrentValue.AutoLoginOutMinutes)); - } + await _fusionCache.SetAsync(CacheKeys.UserToken(identityUserId), userLoginReturnModel.JWTStr, TimeSpan.FromDays(7)); + + await _fusionCache.SetAsync(CacheKeys.UserAutoLoginOut(identityUserId), DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), TimeSpan.FromMinutes(_verifyConfig.CurrentValue.AutoLoginOutMinutes)); + userLoginReturnModel.BasicInfo.AccountList = await _userRoleRepository.Where(t => t.IdentityUserId == identityUserId).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); userLoginReturnModel.CompanyInfo = companyInfo; - await _fusionCache.SetAsync(CacheKeys.UserToken(loginUser.IdentityUserId), userLoginReturnModel.JWTStr, TimeSpan.FromDays(7)); + return ResponseOutput.Ok(userLoginReturnModel);