From 34ed020328add7d2b4919f5ec21321deb2c4faee Mon Sep 17 00:00:00 2001 From: xiaoxian521 <1923740402@qq.com> Date: Wed, 17 Apr 2024 14:56:57 +0800 Subject: [PATCH] chore: update --- locales/en.yaml | 1 + locales/zh-CN.yaml | 1 + src/api/user.ts | 2 +- src/layout/hooks/useNav.ts | 3 ++- src/router/utils.ts | 2 +- src/utils/auth.ts | 2 +- src/views/login/index.vue | 4 ++-- 7 files changed, 9 insertions(+), 6 deletions(-) diff --git a/locales/en.yaml b/locales/en.yaml index 6c235ae28..4605818fe 100644 --- a/locales/en.yaml +++ b/locales/en.yaml @@ -209,6 +209,7 @@ login: pureTip: After scanning the code, click "Confirm" to complete the login pureDefinite: Definite pureLoginSuccess: Login Success + pureLoginFail: Login Fail pureRegisterSuccess: Regist Success pureTickPrivacy: Please tick Privacy Policy pureReadAccept: I have read it carefully and accept diff --git a/locales/zh-CN.yaml b/locales/zh-CN.yaml index ce4da125f..1d2f2ce15 100644 --- a/locales/zh-CN.yaml +++ b/locales/zh-CN.yaml @@ -209,6 +209,7 @@ login: pureTip: 扫码后点击"确认",即可完成登录 pureDefinite: 确定 pureLoginSuccess: 登录成功 + pureLoginFail: 登录失败 pureRegisterSuccess: 注册成功 pureTickPrivacy: 请勾选隐私政策 pureReadAccept: 我已仔细阅读并接受 diff --git a/src/api/user.ts b/src/api/user.ts index 79c30ce0c..58696b665 100644 --- a/src/api/user.ts +++ b/src/api/user.ts @@ -5,7 +5,7 @@ export type UserResult = { data: { /** 用户名 */ username: string; - /** 当前登陆用户的角色 */ + /** 当前登录用户的角色 */ roles: Array; /** `token` */ accessToken: string; diff --git a/src/layout/hooks/useNav.ts b/src/layout/hooks/useNav.ts index c1382caf6..33e6df477 100644 --- a/src/layout/hooks/useNav.ts +++ b/src/layout/hooks/useNav.ts @@ -17,7 +17,8 @@ import { usePermissionStoreHook } from "@/store/modules/permission"; import ExitFullscreen from "@iconify-icons/ri/fullscreen-exit-fill"; import Fullscreen from "@iconify-icons/ri/fullscreen-fill"; -const errorInfo = "当前路由配置不正确,请检查配置"; +const errorInfo = + "The current routing configuration is incorrect, please check the configuration"; export function useNav() { const pureApp = useAppStoreHook(); diff --git a/src/router/utils.ts b/src/router/utils.ts index 35065c723..7df59d74c 100644 --- a/src/router/utils.ts +++ b/src/router/utils.ts @@ -81,7 +81,7 @@ function isOneOfArray(a: Array, b: Array) { : true; } -/** 从localStorage里取出当前登陆用户的角色roles,过滤无权限的菜单 */ +/** 从localStorage里取出当前登录用户的角色roles,过滤无权限的菜单 */ function filterNoPermissionTree(data: RouteComponent[]) { const currentRoles = storageLocal().getItem>(userKey)?.roles ?? []; diff --git a/src/utils/auth.ts b/src/utils/auth.ts index b158ae79d..fc953c919 100644 --- a/src/utils/auth.ts +++ b/src/utils/auth.ts @@ -15,7 +15,7 @@ export interface DataInfo { username?: string; /** 昵称 */ nickname?: string; - /** 当前登陆用户的角色 */ + /** 当前登录用户的角色 */ roles?: Array; } diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 6eb5db3e8..157db3977 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -77,12 +77,12 @@ const onLogin = async (formEl: FormInstance | undefined) => { router .push(getTopMenu(true).path) .then(() => { - message("登录成功", { type: "success" }); + message(t("login.pureLoginSuccess"), { type: "success" }); }) .finally(() => (disabled.value = false)); }); } else { - message("登录失败", { type: "error" }); + message(t("login.pureLoginFail"), { type: "error" }); } }) .finally(() => (loading.value = false));