diff --git a/code/src/Modules/BaseService/BaseService.Application/UserManagement/UserAppService.cs b/code/src/Modules/BaseService/BaseService.Application/UserManagement/UserAppService.cs index 30621f88..88d7bc8d 100644 --- a/code/src/Modules/BaseService/BaseService.Application/UserManagement/UserAppService.cs +++ b/code/src/Modules/BaseService/BaseService.Application/UserManagement/UserAppService.cs @@ -1,3 +1,7 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; using BaseService.BaseData; using BaseService.BaseData.Permissions.Dto; using BaseService.RelationBaseData; @@ -6,10 +10,6 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Mvc; using Omu.ValueInjecter; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; using Volo.Abp; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; @@ -25,7 +25,6 @@ using IdentityUser = Volo.Abp.Identity.IdentityUser; namespace BaseService.Systems.UserManagement { [Route("api/base/user")] - //[Authorize(IdentityPermissions.Users.Default)] public class UserAppService : ApplicationService, IUserAppService { protected IdentityUserManager UserManager { get; } @@ -417,5 +416,13 @@ namespace BaseService.Systems.UserManagement await UserManager.DeleteAsync(entity).ConfigureAwait(false); return new OkResult(); } + + [Route("{userId}/change-password")] + public async Task ChangePassword(Guid userId, ChangePasswordInput input) + { + var user = await UserManager.GetByIdAsync(userId).ConfigureAwait(false); + var result = await UserManager.ChangePasswordAsync(user, input.CurrentPassword, input.NewPassword).ConfigureAwait(false); + result.CheckErrors(); + } } } diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/api/site.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/api/site.js index e81de595..9e01ac51 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/api/site.js +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/api/site.js @@ -2,6 +2,7 @@ async function getLocalizationAsync() { // const url = "abp/application-configuration"; // const data = (await get(url, null, null, true, true)).data; return { + legacy: false, options: [ { value: "zh", @@ -144,6 +145,9 @@ async function getLocalizationAsync() { isOnline: "在线", heartbeat: "心跳", userAgent: "用户代理", + ["Invalid username or password!"]: "用户名或密码错误", + ["The user account has been locked out due to invalid login attempts. Please wait a while and try again."]: "用户已锁定,请稍后重试", + ["Volo.Abp.Identity:PasswordMismatch"]: "密码错误", }, en: { application: "WTA Framework", diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/layouts/header.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/layouts/header.js index d57f347f..40fa8e0a 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/layouts/header.js +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/layouts/header.js @@ -41,13 +41,7 @@ export default { v-model="searchModel" :loading="searchLoading" > - + @@ -63,7 +57,7 @@ export default { - {{ appStore.user.name }} + {{ appStore.user.userName }} @@ -112,9 +106,7 @@ export default { try { searchLoading.value = true; const menus = treeToList(router.getRoutes().find((o) => o.path === "/").children); - searchOptions.value = menus - .filter((o) => !o.children || o.children.length === 0) - .filter((o) => o.meta.fullName.indexOf(query) > -1); + searchOptions.value = menus.filter((o) => !o.children || o.children.length === 0).filter((o) => o.meta.fullName.indexOf(query) > -1); } finally { searchLoading.value = false; } diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/layouts/logo.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/layouts/logo.js index 8fb65d32..e4e4070a 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/layouts/logo.js +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/layouts/logo.js @@ -1,8 +1,9 @@ import html from "html"; import { useAppStore } from "../store/index.js"; +import { reload } from "../utils/index.js"; export default { - template: html`