From d2e0d76479047e498e7d4a1a73bf5753308e1c98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=86=9B?= <510423039@qq.com> Date: Thu, 27 Oct 2022 09:11:15 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=94=A8=E6=88=B7=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=AF=86=E7=A0=81=E5=A4=9A=E8=AF=AD=E8=A8=80=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Users/UserAppService.cs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Application/Users/UserAppService.cs b/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Application/Users/UserAppService.cs index e1bc4e76..b9e1a2c5 100644 --- a/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Application/Users/UserAppService.cs +++ b/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Application/Users/UserAppService.cs @@ -1,9 +1,11 @@ +using Lion.AbpPro.BasicManagement.Localization; using Lion.AbpPro.BasicManagement.Users.Dtos; using Magicodes.ExporterAndImporter.Excel; using Magicodes.ExporterAndImporter.Excel.AspNetCore; using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Mvc; using Volo.Abp.Account; +using Volo.Abp.Identity.Localization; namespace Lion.AbpPro.BasicManagement.Users { @@ -15,18 +17,22 @@ namespace Lion.AbpPro.BasicManagement.Users private readonly IIdentityUserRepository _identityUserRepository; private readonly IExcelExporter _excelExporter; private readonly IOptions _options; + private readonly IStringLocalizer _localizer; + public UserAppService( IIdentityUserAppService identityUserAppService, IdentityUserManager userManager, IIdentityUserRepository userRepository, IExcelExporter excelExporter, - IOptions options) + IOptions options, + IStringLocalizer localizer) { _identityUserAppService = identityUserAppService; _userManager = userManager; _identityUserRepository = userRepository; _excelExporter = excelExporter; _options = options; + _localizer = localizer; } /// @@ -117,8 +123,6 @@ namespace Lion.AbpPro.BasicManagement.Users /// /// 修改密码 /// - /// - /// public async Task ChangePasswordAsync(ChangePasswordInput input) { await _options.SetAsync(); @@ -134,7 +138,7 @@ namespace Lion.AbpPro.BasicManagement.Users } return !result.Succeeded - ? throw new UserFriendlyException(result?.Errors?.FirstOrDefault()?.Description) + ? throw new BusinessException("Volo.Abp.Identity:" + result?.Errors?.FirstOrDefault()?.Code) : result.Succeeded; } @@ -151,4 +155,4 @@ namespace Lion.AbpPro.BasicManagement.Users await _userManager.UpdateAsync(identityUser); } } -} +} \ No newline at end of file