From 59d20edabe0dcf1c6dd40e4343d93b31579be9aa Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 23 Nov 2022 16:54:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=82=AE=E4=BB=B6bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Common/MailService.cs | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Common/MailService.cs b/IRaCIS.Core.Application/Service/Common/MailService.cs index 60aaa3b91..417f1c038 100644 --- a/IRaCIS.Core.Application/Service/Common/MailService.cs +++ b/IRaCIS.Core.Application/Service/Common/MailService.cs @@ -80,7 +80,7 @@ namespace IRaCIS.Application.Services } - //重置邮箱 + //重置邮箱 public async Task SendMailEditEmail(Guid userId, string userName, string emailAddress, int verificationCode) { @@ -523,12 +523,15 @@ namespace IRaCIS.Application.Services saveItem.DoctorId = doctorId; saveItem.UserTypeId = userType.Id; - sysUserInfo = await _userRepository.AddAsync(saveItem); + var savedUser = await _userRepository.AddAsync(saveItem); + + //下面获取Token 需要这部分信息 + sysUserInfo =savedUser.Clone(); + + sysUserInfo.UserTypeRole = userType; await _userRepository.SaveChangesAsync(); - - sysUserInfo.UserTypeRole = userType; } else { @@ -551,7 +554,13 @@ namespace IRaCIS.Application.Services var builder = new BodyBuilder(); - var token = _tokenService.GetToken(IRaCISClaims.Create(_mapper.Map(sysUserInfo))); + var basicInfo = IRaCISClaims.Create(_mapper.Map(sysUserInfo)); + + ////第一次添加的时候 注意赋值 + //basicInfo.PermissionStr = userType.PermissionStr; + //basicInfo.UserTypeShortName = userType.UserTypeShortName; + + var token = _tokenService.GetToken(basicInfo); if (sysUserInfo.IsFirstAdd) {