refactor!: 升级 @nuxt/ui@3,重构所有页面和组件,调整配置,移除不在需求中的页面
This commit is contained in:
19
app/app.vue
19
app/app.vue
@@ -4,7 +4,7 @@ import ModalAuthentication from '~/components/ModalAuthentication.vue'
|
||||
const toast = useToast()
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
const modal = useModal()
|
||||
const overlay = useOverlay()
|
||||
const loginState = useLoginState()
|
||||
|
||||
useHead({
|
||||
@@ -24,10 +24,11 @@ onMounted(() => {
|
||||
toast.add({
|
||||
title: '登录失效',
|
||||
description: '登录已过期,请重新登录',
|
||||
color: 'red',
|
||||
color: 'error',
|
||||
icon: 'i-tabler-alert-triangle',
|
||||
})
|
||||
modal.open(ModalAuthentication)
|
||||
const modal = overlay.create(ModalAuthentication)
|
||||
modal.open()
|
||||
} else if (!loggedIn && !loginState.token) {
|
||||
// Prevents redirect from register page
|
||||
if (route.path === '/user/register') return
|
||||
@@ -41,12 +42,10 @@ onMounted(() => {
|
||||
<div>
|
||||
<NuxtLoadingIndicator />
|
||||
|
||||
<NuxtLayout>
|
||||
<NuxtPage />
|
||||
</NuxtLayout>
|
||||
|
||||
<UModals />
|
||||
<USlideovers />
|
||||
<UNotifications />
|
||||
<UApp>
|
||||
<NuxtLayout>
|
||||
<NuxtPage />
|
||||
</NuxtLayout>
|
||||
</UApp>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user