mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-14 09:38:13 +08:00
♻️ 姑且没登录的功能都给试了下
This commit is contained in:
@@ -82,7 +82,7 @@
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { app } from "@tauri-apps/api";
|
||||
import { appWindow } from "@tauri-apps/api/window";
|
||||
import { webviewWindow } from "@tauri-apps/api";
|
||||
import { nextTick, onMounted, onUnmounted, ref, watch } from "vue";
|
||||
import { useRoute } from "vue-router";
|
||||
|
||||
@@ -123,13 +123,13 @@ const shareTimeTimer = ref<any>();
|
||||
const showCollection = ref<boolean>(false);
|
||||
|
||||
onMounted(async () => {
|
||||
await appWindow.show();
|
||||
await webviewWindow.getCurrent().show();
|
||||
appVersion.value = await app.getVersion();
|
||||
// 检查数据
|
||||
if (!postId) {
|
||||
loadingEmpty.value = true;
|
||||
loadingTitle.value = "未找到数据";
|
||||
await appWindow.setTitle("未找到数据");
|
||||
await webviewWindow.getCurrent().setTitle("未找到数据");
|
||||
await TGLogger.Error("[t-post][onMounted] PostID 不存在");
|
||||
return;
|
||||
}
|
||||
@@ -140,7 +140,7 @@ onMounted(async () => {
|
||||
loadingTitle.value = "正在渲染数据...";
|
||||
renderPost.value = getRenderPost(postData.value);
|
||||
shareTitle.value = `Post_${postId}`;
|
||||
await appWindow.setTitle(`Post_${postId} ${postData.value.post.subject}`);
|
||||
await webviewWindow.getCurrent().setTitle(`Post_${postId} ${postData.value.post.subject}`);
|
||||
} catch (error) {
|
||||
if (error instanceof Error) {
|
||||
await TGLogger.Error(`[t-post][${postId}] ${error.name}: ${error.message}`);
|
||||
@@ -152,7 +152,7 @@ onMounted(async () => {
|
||||
loadingSub.value = "请检查帖子是否存在或者是否为合法的帖子";
|
||||
}
|
||||
loadingEmpty.value = true;
|
||||
await appWindow.setTitle(`Post_${postId} Parsing Error`);
|
||||
await webviewWindow.getCurrent().setTitle(`Post_${postId} Parsing Error`);
|
||||
return;
|
||||
}
|
||||
await TGLogger.Info(`[t-post][${postId}][onMounted] ${postData.value.post.subject}`);
|
||||
|
||||
Reference in New Issue
Block a user