mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-06-28 02:51:56 +08:00
roolback
This commit is contained in:
33
src/App.vue
33
src/App.vue
@@ -10,9 +10,6 @@ globalTheme.name.value = localStorage.getItem('theme') || 'light'
|
||||
// 提示框
|
||||
const $toast = useToast()
|
||||
|
||||
// 是否加载完成
|
||||
const isLoaded = ref(false)
|
||||
|
||||
// SSE持续接收消息
|
||||
function startSSEMessager() {
|
||||
const token = store.state.auth.token
|
||||
@@ -33,42 +30,14 @@ function startSSEMessager() {
|
||||
}
|
||||
}
|
||||
|
||||
// 是否LG大屏幕
|
||||
const isLargeScreen = ref(false)
|
||||
// 检测屏幕大小
|
||||
function checkScreenSize() {
|
||||
const screenWidth = window.innerWidth
|
||||
isLargeScreen.value = screenWidth >= 1024
|
||||
}
|
||||
|
||||
// 页面加载时,加载当前用户数据
|
||||
onBeforeMount(async () => {
|
||||
checkScreenSize()
|
||||
startSSEMessager()
|
||||
// 如果是小屏幕,1秒后才显示界面
|
||||
if (!isLargeScreen.value) {
|
||||
setTimeout(() => {
|
||||
isLoaded.value = true
|
||||
}, 500)
|
||||
}
|
||||
else {
|
||||
isLoaded.value = true
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div
|
||||
v-if="!isLoaded"
|
||||
class="mt-12 w-full text-center text-gray-500 text-sm flex flex-col items-center"
|
||||
>
|
||||
<VProgressCircular
|
||||
size="48"
|
||||
indeterminate
|
||||
color="primary"
|
||||
/>
|
||||
</div>
|
||||
<VApp v-show="isLoaded">
|
||||
<VApp>
|
||||
<RouterView />
|
||||
</VApp>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user