diff --git a/.env b/.env index 5992ff0..7181b8e 100644 --- a/.env +++ b/.env @@ -8,7 +8,7 @@ VITE_APP_NAME = Nova - Admin VITE_ROUTE_MODE = web # 路由加载模式 static | dynamic -VITE_ROUTE_LOAD_MODE = static +VITE_ROUTE_LOAD_MODE = dynamic # 设置登陆后跳转地址 VITE_HOME_PATH = /home diff --git a/src/layouts/components/header/UserCenter.vue b/src/layouts/components/header/UserCenter.vue index daba447..f598273 100644 --- a/src/layouts/components/header/UserCenter.vue +++ b/src/layouts/components/header/UserCenter.vue @@ -8,7 +8,7 @@ import IconUser from '~icons/icon-park-outline/user' const { t } = useI18n() -const { userInfo, logout } = useAuthStore() +const authStore = useAuthStore() const router = useRouter() const options = computed(() => { @@ -56,7 +56,7 @@ function handleSelect(key: string | number) { positiveText: t('common.confirm'), negativeText: t('common.cancel'), onPositiveClick: () => { - logout() + authStore.logout() }, }) } @@ -72,6 +72,10 @@ function handleSelect(key: string | number) { if (key === 'docs') window.open('https://nova-admin-docs.pages.dev/') } + +const avatarUrl = computed(() => { + return authStore.userInfo?.avatar || `https://api.dicebear.com/9.x/adventurer-neutral/svg?seed=${authStore.userInfo?.username}` +})