diff --git a/src/App.vue b/src/App.vue index 91db6228..f0613f1d 100644 --- a/src/App.vue +++ b/src/App.vue @@ -48,7 +48,6 @@ onBeforeMount(async () => { }); onMounted(async () => { - // 获取当前主题 document.documentElement.className = theme.value; await listenOnTheme(); }); @@ -82,12 +81,9 @@ async function listenOnInit(): Promise { } async function checkAppLoad(): Promise { - if (appStore.loading) { - console.info("数据已加载!"); - return; - } const checkDB = await TGSqlite.check(); if (!checkDB) { + appStore.loading = false; await TGSqlite.reset(); showSnackbar({ text: "检测到数据库不完整!已重置数据库!", @@ -95,6 +91,7 @@ async function checkAppLoad(): Promise { timeout: 3000, }); await createDataDir(); + router.go(0); } else { appStore.loading = true; console.info("数据库已加载!"); diff --git a/src/components/post/tp-video.vue b/src/components/post/tp-video.vue index 33b37810..c57f3163 100644 --- a/src/components/post/tp-video.vue +++ b/src/components/post/tp-video.vue @@ -7,7 +7,7 @@ :src="props.data.insert.video" :allowfullscreen="false" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" - sandbox="allow-forms allow-same-origin allow-popups allow-presentation" + sandbox="allow-forms allow-same-origin allow-popups allow-presentation allow-scripts" > diff --git a/src/pages/common/Home.vue b/src/pages/common/Home.vue index 545ac5d2..bc12172f 100644 --- a/src/pages/common/Home.vue +++ b/src/pages/common/Home.vue @@ -33,9 +33,10 @@ const timer = ref(null); function readLoading(): void { if (!loading.value) return; - const loadingMap = itemRefs.value.map((item) => { + let loadingMap = itemRefs.value.map((item) => { return item.loading ? item.name : null; }); + if (!appStore.loading) loadingMap.push("数据库"); loadingSubtitle.value = "正在加载 " + loadingMap.filter((item) => item)?.join("、"); if (loadingMap.every((item) => !item)) { loading.value = false;