refactor: 移除用户存储及相关演示用户逻辑
This commit is contained in:
+1
-14
@@ -2,25 +2,16 @@
|
||||
import { computed, ref, watch } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { useHead, useSeoMeta } from '#imports'
|
||||
import { useUserStore } from '~/stores/user'
|
||||
import { useAppStore } from '~/stores/app'
|
||||
import { usePageScrollLock } from '~/composables/usePageScrollLock'
|
||||
import HomeIntro from '~/components/home/HomeIntro.vue'
|
||||
import HomeHero from '~/components/home/HomeHero.vue'
|
||||
|
||||
const { t } = useI18n()
|
||||
const userStore = useUserStore()
|
||||
const appStore = useAppStore()
|
||||
|
||||
const isIntroActive = ref(true)
|
||||
|
||||
const demoUserName = computed(() => userStore.displayName)
|
||||
const demoUserRole = computed(() => userStore.role)
|
||||
|
||||
if (!userStore.isLoggedIn) {
|
||||
userStore.loadDemoUser()
|
||||
}
|
||||
|
||||
// 保证即使 Lenis 还没加载完成,也能通过原生 CSS 锁定页面
|
||||
useHead({
|
||||
htmlAttrs: {
|
||||
@@ -57,11 +48,7 @@ watch(() => appStore.isAppLoading, async (isLoading) => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<main
|
||||
id="top"
|
||||
:data-demo-user="demoUserName"
|
||||
:data-demo-user-role="demoUserRole"
|
||||
>
|
||||
<main id="top">
|
||||
<HomeIntro ref="homeIntroRef" />
|
||||
<HomeHero ref="homeHeroRef" />
|
||||
|
||||
|
||||
Reference in New Issue
Block a user