From 17aa044da7124e4df17a4c1dfdb4fa136b70f0e7 Mon Sep 17 00:00:00 2001 From: dap <15891557205@163.com> Date: Mon, 2 Sep 2024 15:37:32 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E7=A7=9F=E6=88=B7=E9=80=89=E4=B8=AD?= =?UTF-8?q?=E7=8A=B6=E6=80=81=20=E4=B8=8D=E6=98=BE=E7=A4=BA=E4=B8=AA?= =?UTF-8?q?=E4=BA=BA=E4=B8=AD=E5=BF=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web-antd/src/layouts/basic.vue | 75 +++++++++++++++++------------ 1 file changed, 43 insertions(+), 32 deletions(-) diff --git a/apps/web-antd/src/layouts/basic.vue b/apps/web-antd/src/layouts/basic.vue index f7849000..8eb2ee2f 100644 --- a/apps/web-antd/src/layouts/basic.vue +++ b/apps/web-antd/src/layouts/basic.vue @@ -21,48 +21,59 @@ import TenantToggle from '#/components/TenantToggle/index.vue'; import { $t } from '#/locales'; import { resetRoutes } from '#/router'; import { useAuthStore, useNotifyStore } from '#/store'; +import { useTenantStore } from '#/store/tenant'; const userStore = useUserStore(); const authStore = useAuthStore(); const accessStore = useAccessStore(); const router = useRouter(); -const menus = computed(() => [ - { - handler: () => { - openWindow(VBEN_DOC_URL, { - target: '_blank', - }); +const tenantStore = useTenantStore(); +const menus = computed(() => { + const defaultMenus = [ + { + handler: () => { + openWindow(VBEN_DOC_URL, { + target: '_blank', + }); + }, + icon: BookOpenText, + text: $t('widgets.document'), }, - icon: BookOpenText, - text: $t('widgets.document'), - }, - { - handler: () => { - router.push('/profile'); + { + handler: () => { + router.push('/profile'); + }, + icon: ProfileIcon, + text: $t('widgets.profile'), }, - icon: ProfileIcon, - text: $t('widgets.profile'), - }, - { - handler: () => { - openWindow(VBEN_GITHUB_URL, { - target: '_blank', - }); + { + handler: () => { + openWindow(VBEN_GITHUB_URL, { + target: '_blank', + }); + }, + icon: MdiGithub, + text: 'GitHub', }, - icon: MdiGithub, - text: 'GitHub', - }, - { - handler: () => { - openWindow(`${VBEN_GITHUB_URL}/issues`, { - target: '_blank', - }); + { + handler: () => { + openWindow(`${VBEN_GITHUB_URL}/issues`, { + target: '_blank', + }); + }, + icon: CircleHelp, + text: $t('widgets.qa'), }, - icon: CircleHelp, - text: $t('widgets.qa'), - }, -]); + ]; + /** + * 租户选中状态 不显示个人中心 + */ + if (tenantStore.checked) { + defaultMenus.splice(1, 1); + } + return defaultMenus; +}); const { loginLoading } = storeToRefs(authStore);