diff --git a/IRaCIS.Core.API/Controllers/ExtraController.cs b/IRaCIS.Core.API/Controllers/ExtraController.cs index d72ea429d..ba82aa1fa 100644 --- a/IRaCIS.Core.API/Controllers/ExtraController.cs +++ b/IRaCIS.Core.API/Controllers/ExtraController.cs @@ -228,7 +228,7 @@ namespace IRaCIS.Api.Controllers [HttpGet("User/UserRedirect")] [AllowAnonymous] - public async Task UserRedirect([FromServices] IRepository _userRoleRepository, string url, [FromServices] ILogger _logger) + public async Task UserRedirect([FromServices] IRepository _useRepository, string url, [FromServices] ILogger _logger, [FromServices] ITokenService _tokenService) { var decodeUrl = System.Web.HttpUtility.UrlDecode(url); @@ -243,10 +243,22 @@ namespace IRaCIS.Api.Controllers var errorUrl = domainStrList[0] + "//" + domainStrList[2] + "/error"; - - if (!await _userRoleRepository.AnyAsync(t => t.Id == Guid.Parse(userId) && t.EmailToken == token && t.IsFirstAdd)) + if (lang == "zh") { - decodeUrl = errorUrl + $"?lang={lang}&ErrorMessage={System.Web.HttpUtility.UrlEncode(lang == "zh" ? "您的初始化链接已过期" : "Error!The initialization link has expired. Return")} "; + CultureInfo.CurrentCulture = new CultureInfo(StaticData.CultureInfo.zh_CN); + CultureInfo.CurrentUICulture = new CultureInfo(StaticData.CultureInfo.zh_CN); + } + else + { + CultureInfo.CurrentCulture = new CultureInfo(StaticData.CultureInfo.en_US); + CultureInfo.CurrentUICulture = new CultureInfo(StaticData.CultureInfo.en_US); + } + + var isExpire = _tokenService.IsTokenExpired(token); + + if (!await _useRepository.AnyAsync(t => t.Id == Guid.Parse(userId) && t.EmailToken == token && t.IsFirstAdd) || isExpire) + { + decodeUrl = errorUrl + $"?lang={lang}&ErrorMessage={System.Web.HttpUtility.UrlEncode(I18n.T("UserRedirect_InitializationLinkExpire"))} "; } return Redirect(decodeUrl); diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index 063ab32fc..6e72d2ffc 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -13726,14 +13726,6 @@ - - - 项目退出历史数据维护 - - - - - 用户多账号,初次维护数据 @@ -13747,6 +13739,23 @@ + + + 项目退出历史数据维护 + + + + + + + + 给影像库所有检查 打上课题组标签 + + + + + + 外部人员 中心调研人员维护 diff --git a/IRaCIS.Core.Application/Service/Common/MailService.cs b/IRaCIS.Core.Application/Service/Common/MailService.cs index a408f4e47..58549f1f3 100644 --- a/IRaCIS.Core.Application/Service/Common/MailService.cs +++ b/IRaCIS.Core.Application/Service/Common/MailService.cs @@ -383,7 +383,7 @@ namespace IRaCIS.Core.Application.Service //管理员重置密码发送邮件 public async Task AdminResetPwdSendEmailAsync(Guid userId, string pwdNotMd5 = "123456") { - var sysUserInfo = (await _userRoleRepository.Where(t => t.Id == userId).Include(t => t.UserTypeRole).FirstOrDefaultAsync()).IfNullThrowException(); + var sysUserInfo = (await _identityUserRepository.Where(t => t.Id == userId).Include(t => t.UserRoleList).ThenInclude(c => c.UserTypeRole).FirstOrDefaultAsync()).IfNullThrowException(); var messageToSend = new MimeMessage(); //发件地址 @@ -403,7 +403,7 @@ namespace IRaCIS.Core.Application.Service sysUserInfo.FullName, sysUserInfo.UserName, - sysUserInfo.UserTypeRole.UserTypeShortName, + "", pwdNotMd5 ); diff --git a/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs b/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs index c36602cb3..94076cdfd 100644 --- a/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs +++ b/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs @@ -401,7 +401,7 @@ namespace IRaCIS.Core.Application.Service //用户的数据稽查没有 临时处理 - var userObj = await _userRoleRepository.Where(t => t.Id == objectRelationParentId).Select(t => new { UserRealName = t.FullName, t.Phone, t.UserName, UserType = t.UserTypeRole.UserTypeShortName, t.EMail, t.OrganizationName }).FirstOrDefaultAsync(); + var userObj = await _userRoleRepository.Where(t => t.Id == objectRelationParentId).Select(t => new { UserRealName = t.IdentityUser.FullName, t.IdentityUser.Phone, t.IdentityUser.UserName, UserType = t.UserTypeRole.UserTypeShortName, t.UserTypeEnum, t.IdentityUser.EMail, t.IdentityUser.OrganizationName }).FirstOrDefaultAsync(); if (userObj != null) { diff --git a/IRaCIS.Core.Application/Service/Management/UserService.cs b/IRaCIS.Core.Application/Service/Management/UserService.cs index b620a4954..f37e84d50 100644 --- a/IRaCIS.Core.Application/Service/Management/UserService.cs +++ b/IRaCIS.Core.Application/Service/Management/UserService.cs @@ -1039,14 +1039,15 @@ namespace IRaCIS.Core.Application.Service [HttpPut("{newCheckCode}")] public async Task SetNewCheckCode(string newCheckCode) { - var user = await _userRoleRepository.FirstOrDefaultNoTrackingAsync(t => t.Id == _userInfo.UserRoleId); + var user = await _identityUserRepository.FirstOrDefaultNoTrackingAsync(t => t.Id == _userInfo.IdentityUserId); - await _userRoleRepository.UpdatePartialFromQueryAsync(t => t.EMail == user.EMail, u => new UserRole() + await _identityUserRepository.UpdatePartialFromQueryAsync(t => t.EMail == user.EMail, u => new IdentityUser() { CheckCode = newCheckCode }); - await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, LoginUserId = _userInfo.UserRoleId, OptUserId = _userInfo.UserRoleId, OptType = UserOptType.ModifyCheckCode }, true); + await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, ActionIdentityUserId = _userInfo.IdentityUserId, ActionUserName = _userInfo.UserName, TargetIdentityUserId = _userInfo.IdentityUserId, OptType = UserOptType.ModifyCheckCode }, true); + return ResponseOutput.Ok(); }