From 860fc15ce6eeaaba9fb41c2385f4233d9d5fe3f9 Mon Sep 17 00:00:00 2001 From: Vben Date: Sun, 20 Oct 2024 21:44:25 +0800 Subject: [PATCH] perf: adjustment of form spelling errors, type adjustment, closer to actual development (#4694) --- .../src/locales/langs/zh-CN/page.json | 6 ++-- apps/web-antd/src/store/auth.ts | 7 ++--- .../views/_core/authentication/code-login.vue | 5 ++-- .../_core/authentication/forget-password.vue | 3 +- .../views/_core/authentication/register.vue | 5 ++-- .../web-ele/src/locales/langs/zh-CN/page.json | 6 ++-- apps/web-ele/src/store/auth.ts | 7 ++--- .../views/_core/authentication/code-login.vue | 5 ++-- .../_core/authentication/forget-password.vue | 3 +- .../views/_core/authentication/register.vue | 5 ++-- .../src/locales/langs/zh-CN/page.json | 6 ++-- apps/web-naive/src/store/auth.ts | 7 ++--- .../views/_core/authentication/code-login.vue | 5 ++-- .../_core/authentication/forget-password.vue | 3 +- .../views/_core/authentication/register.vue | 5 ++-- docs/src/guide/in-depth/access.md | 2 +- packages/constants/src/core.ts | 2 +- .../src/ui/authentication/code-login.vue | 13 ++++----- .../src/ui/authentication/forget-password.vue | 12 ++++---- .../common-ui/src/ui/authentication/index.ts | 6 +--- .../common-ui/src/ui/authentication/login.vue | 12 ++++---- .../src/ui/authentication/qrcode-login.vue | 2 +- .../src/ui/authentication/register.vue | 12 ++++---- .../common-ui/src/ui/authentication/types.ts | 28 +------------------ .../widgets/lock-screen/lock-screen-modal.vue | 17 ++++------- playground/src/locales/langs/zh-CN/page.json | 6 ++-- playground/src/store/auth.ts | 7 ++--- .../views/_core/authentication/code-login.vue | 5 ++-- .../_core/authentication/forget-password.vue | 2 +- .../views/_core/authentication/register.vue | 5 ++-- .../src/views/demos/access/button-control.vue | 4 +-- playground/src/views/demos/access/index.vue | 4 +-- 32 files changed, 95 insertions(+), 122 deletions(-) diff --git a/apps/web-antd/src/locales/langs/zh-CN/page.json b/apps/web-antd/src/locales/langs/zh-CN/page.json index 85fa1597..4cb67081 100644 --- a/apps/web-antd/src/locales/langs/zh-CN/page.json +++ b/apps/web-antd/src/locales/langs/zh-CN/page.json @@ -1,9 +1,9 @@ { "auth": { - "login": "登陆", + "login": "登录", "register": "注册", - "codeLogin": "验证码登陆", - "qrcodeLogin": "二维码登陆", + "codeLogin": "验证码登录", + "qrcodeLogin": "二维码登录", "forgetPassword": "忘记密码" }, "dashboard": { diff --git a/apps/web-antd/src/store/auth.ts b/apps/web-antd/src/store/auth.ts index 87ee0cc4..9d64d205 100644 --- a/apps/web-antd/src/store/auth.ts +++ b/apps/web-antd/src/store/auth.ts @@ -1,5 +1,4 @@ -import type { LoginAndRegisterParams } from '@vben/common-ui'; -import type { UserInfo } from '@vben/types'; +import type { Recordable, UserInfo } from '@vben/types'; import { ref } from 'vue'; import { useRouter } from 'vue-router'; @@ -26,7 +25,7 @@ export const useAuthStore = defineStore('auth', () => { * @param params 登录表单数据 */ async function authLogin( - params: LoginAndRegisterParams, + params: Recordable, onSuccess?: () => Promise | void, ) { // 异步处理用户登录操作并获取 accessToken @@ -84,7 +83,7 @@ export const useAuthStore = defineStore('auth', () => { resetAllStores(); accessStore.setLoginExpired(false); - // 回登陆页带上当前路由地址 + // 回登录页带上当前路由地址 await router.replace({ path: LOGIN_PATH, query: redirect diff --git a/apps/web-antd/src/views/_core/authentication/code-login.vue b/apps/web-antd/src/views/_core/authentication/code-login.vue index 03cf5502..556b273a 100644 --- a/apps/web-antd/src/views/_core/authentication/code-login.vue +++ b/apps/web-antd/src/views/_core/authentication/code-login.vue @@ -1,5 +1,6 @@