From e311cfb8da6bac2412704a3e245edc8c5a377c01 Mon Sep 17 00:00:00 2001 From: xingyu4j Date: Mon, 10 Nov 2025 17:51:10 +0800 Subject: [PATCH] feat: route add profile --- apps/web-antd/src/layouts/basic.vue | 9 +++++++++ apps/web-antd/src/locales/langs/en-US/page.json | 3 ++- apps/web-antd/src/locales/langs/zh-CN/page.json | 3 ++- apps/web-antd/src/router/routes/modules/vben.ts | 10 ++++++++++ 4 files changed, 23 insertions(+), 2 deletions(-) diff --git a/apps/web-antd/src/layouts/basic.vue b/apps/web-antd/src/layouts/basic.vue index 805b8a73..8c5c663a 100644 --- a/apps/web-antd/src/layouts/basic.vue +++ b/apps/web-antd/src/layouts/basic.vue @@ -2,6 +2,7 @@ import type { NotificationItem } from '@vben/layouts'; import { computed, ref, watch } from 'vue'; +import { useRouter } from 'vue-router'; import { AuthenticationLoginExpiredModal } from '@vben/common-ui'; import { VBEN_DOC_URL, VBEN_GITHUB_URL } from '@vben/constants'; @@ -52,6 +53,7 @@ const notifications = ref([ }, ]); +const router = useRouter(); const userStore = useUserStore(); const authStore = useAuthStore(); const accessStore = useAccessStore(); @@ -61,6 +63,13 @@ const showDot = computed(() => ); const menus = computed(() => [ + { + handler: () => { + router.push({ name: 'Profile' }); + }, + icon: 'lucide:user', + text: $t('page.auth.profile'), + }, { handler: () => { openWindow(VBEN_DOC_URL, { diff --git a/apps/web-antd/src/locales/langs/en-US/page.json b/apps/web-antd/src/locales/langs/en-US/page.json index 618a258c..39f1641c 100644 --- a/apps/web-antd/src/locales/langs/en-US/page.json +++ b/apps/web-antd/src/locales/langs/en-US/page.json @@ -4,7 +4,8 @@ "register": "Register", "codeLogin": "Code Login", "qrcodeLogin": "Qr Code Login", - "forgetPassword": "Forget Password" + "forgetPassword": "Forget Password", + "profile": "Profile" }, "dashboard": { "title": "Dashboard", 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 4cb67081..2192d1d5 100644 --- a/apps/web-antd/src/locales/langs/zh-CN/page.json +++ b/apps/web-antd/src/locales/langs/zh-CN/page.json @@ -4,7 +4,8 @@ "register": "注册", "codeLogin": "验证码登录", "qrcodeLogin": "二维码登录", - "forgetPassword": "忘记密码" + "forgetPassword": "忘记密码", + "profile": "个人中心" }, "dashboard": { "title": "概览", diff --git a/apps/web-antd/src/router/routes/modules/vben.ts b/apps/web-antd/src/router/routes/modules/vben.ts index 4a8cdb0a..631facc0 100644 --- a/apps/web-antd/src/router/routes/modules/vben.ts +++ b/apps/web-antd/src/router/routes/modules/vben.ts @@ -89,6 +89,16 @@ const routes: RouteRecordRaw[] = [ order: 9999, }, }, + { + name: 'Profile', + path: '/profile', + component: () => import('#/views/_core/profile/index.vue'), + meta: { + icon: 'lucide:user', + hideInMenu: true, + title: $t('page.auth.profile'), + }, + }, ]; export default routes;