mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-04 23:18:44 +08:00
roolback
This commit is contained in:
+1
-32
@@ -10,9 +10,6 @@ globalTheme.name.value = localStorage.getItem('theme') || 'light'
|
|||||||
// 提示框
|
// 提示框
|
||||||
const $toast = useToast()
|
const $toast = useToast()
|
||||||
|
|
||||||
// 是否加载完成
|
|
||||||
const isLoaded = ref(false)
|
|
||||||
|
|
||||||
// SSE持续接收消息
|
// SSE持续接收消息
|
||||||
function startSSEMessager() {
|
function startSSEMessager() {
|
||||||
const token = store.state.auth.token
|
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 () => {
|
onBeforeMount(async () => {
|
||||||
checkScreenSize()
|
|
||||||
startSSEMessager()
|
startSSEMessager()
|
||||||
// 如果是小屏幕,1秒后才显示界面
|
|
||||||
if (!isLargeScreen.value) {
|
|
||||||
setTimeout(() => {
|
|
||||||
isLoaded.value = true
|
|
||||||
}, 500)
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
isLoaded.value = true
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div
|
<VApp>
|
||||||
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">
|
|
||||||
<RouterView />
|
<RouterView />
|
||||||
</VApp>
|
</VApp>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
Reference in New Issue
Block a user