♻️ 姑且没登录的功能都给试了下

This commit is contained in:
目棃
2024-07-03 17:49:15 +08:00
parent 367307029b
commit 8a2c7d13c6
47 changed files with 1135 additions and 315 deletions

View File

@@ -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}`);