From 8493d5f7c5ed27184c4a6bd69b343a720cf36fc3 Mon Sep 17 00:00:00 2001 From: wanggang <76527413@qq.com> Date: Thu, 24 Aug 2023 16:44:59 +0800 Subject: [PATCH] up --- .../UserManagement/UserAppService.cs | 17 +++-- .../wwwroot/api/site.js | 4 ++ .../wwwroot/layouts/header.js | 14 +--- .../wwwroot/layouts/logo.js | 4 +- .../wwwroot/locale/index.js | 14 ++-- .../wwwroot/main.js | 4 +- .../wwwroot/models/account.js | 38 +++++++++++ .../wwwroot/models/settle/inventory-detail.js | 27 ++++++-- .../wwwroot/request/index.js | 9 ++- .../wwwroot/router/index.js | 8 +++ .../wwwroot/styles/site.css | 3 +- .../wwwroot/utils/index.js | 17 ++--- .../wwwroot/utils/validation.js | 4 +- .../wwwroot/views/account.js | 64 +++++++++++++++++++ .../wwwroot/views/login.js | 23 ++++--- 15 files changed, 185 insertions(+), 65 deletions(-) create mode 100644 code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/account.js create mode 100644 code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/account.js 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`