mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-15 09:48:14 +08:00
🎨 调整条件
This commit is contained in:
@@ -101,9 +101,9 @@ import VpBtnReply from "@comp/viewPost/vp-btn-reply.vue";
|
||||
import VpOverlayCollection from "@comp/viewPost/vp-overlay-collection.vue";
|
||||
import Mys from "@Mys/index.js";
|
||||
import { app, webviewWindow } from "@tauri-apps/api";
|
||||
import { emit } from "@tauri-apps/api/event";
|
||||
import { emit, listen, UnlistenFn } from "@tauri-apps/api/event";
|
||||
import { storeToRefs } from "pinia";
|
||||
import { onMounted, onUnmounted, ref, shallowRef } from "vue";
|
||||
import { onBeforeMount, onMounted, onUnmounted, ref, shallowRef } from "vue";
|
||||
import { useRoute } from "vue-router";
|
||||
|
||||
import { useAppStore } from "@/store/modules/app.js";
|
||||
@@ -126,6 +126,7 @@ const postData = shallowRef<TGApp.Plugins.Mys.Post.FullData>();
|
||||
|
||||
// eslint-disable-next-line no-undef
|
||||
let shareTimer: NodeJS.Timeout | null = null;
|
||||
let incognitoListener: UnlistenFn | null = null;
|
||||
|
||||
function getGameIcon(gameId: number): string {
|
||||
const find = TGBbs.channels.find((item) => item.gid === gameId);
|
||||
@@ -133,6 +134,17 @@ function getGameIcon(gameId: number): string {
|
||||
return "/platforms/mhy/mys.webp";
|
||||
}
|
||||
|
||||
onBeforeMount(async () => {
|
||||
incognitoListener = await listen<void>("switchIncognito", () => window.location.reload());
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
if (incognitoListener !== null) {
|
||||
incognitoListener();
|
||||
incognitoListener = null;
|
||||
}
|
||||
});
|
||||
|
||||
onMounted(async () => {
|
||||
await showLoading.start(`正在加载帖子数据`);
|
||||
appVersion.value = await app.getVersion();
|
||||
@@ -268,6 +280,10 @@ async function tryLike(): Promise<void> {
|
||||
showSnackbar.error("数据未加载");
|
||||
return;
|
||||
}
|
||||
if (!incognito.value) {
|
||||
showSnackbar.error("无法在无痕浏览模式下操作");
|
||||
return;
|
||||
}
|
||||
const ck = { ltoken: cookie.value.ltoken, ltuid: cookie.value.ltuid };
|
||||
const resp = await apiHubReq.post.like(postData.value.post.post_id, ck, isLike.value);
|
||||
if (resp.retcode !== 0) {
|
||||
|
||||
Reference in New Issue
Block a user