diff --git a/IRaCIS.Core.Application/Service/Common/MailService.cs b/IRaCIS.Core.Application/Service/Common/MailService.cs index 60aaa3b9..417f1c03 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) {