diff --git a/src/components/pageWiki/two-select-c.vue b/src/components/pageWiki/two-select-c.vue index 4be8918f..47ad9cac 100644 --- a/src/components/pageWiki/two-select-c.vue +++ b/src/components/pageWiki/two-select-c.vue @@ -104,21 +104,13 @@ interface TwoSelectCEmits { const props = defineProps(); const emits = defineEmits(); -const visible = computed({ - get() { - return props.modelValue; - }, - set(value) { - emits("update:modelValue", value); - }, +const visible = computed({ + get: () => props.modelValue, + set: (v: boolean) => emits("update:modelValue", v), }); -const reset = computed({ - get() { - return props.reset; - }, - set(value) { - emits("update:reset", value); - }, +const reset = computed({ + get: () => props.reset, + set: (v: boolean) => emits("update:reset", v), }); watch( diff --git a/src/pages/common/PageConfig.vue b/src/pages/common/PageConfig.vue index 1ffc75a6..e6804edb 100644 --- a/src/pages/common/PageConfig.vue +++ b/src/pages/common/PageConfig.vue @@ -80,6 +80,7 @@ 刷新设备信息 + {{ appStore.deviceInfo.device_name }}({{ appStore.deviceInfo.product }}) - {{ appStore.deviceInfo.device_fp }} diff --git a/src/utils/linkParser.ts b/src/utils/linkParser.ts index 42d611d9..c265c19a 100644 --- a/src/utils/linkParser.ts +++ b/src/utils/linkParser.ts @@ -1,13 +1,14 @@ /** * @file src/utils/linkParser.ts * @description 处理链接 - * @since Beta v0.6.3 + * @since Beta v0.6.5 */ import { emit } from "@tauri-apps/api/event"; import showDialog from "../components/func/dialog.js"; import showSnackbar from "../components/func/snackbar.js"; +import { getGameId } from "../web/utils/tools.js"; import TGClient from "./TGClient.js"; import { createPost } from "./TGWindow.js"; @@ -56,7 +57,7 @@ export async function parsePost(link: string): Promise { /** * @function parseLink - * @since Beta v0.6.3 + * @since Beta v0.6.5 * @description 处理链接 * @param {string} link - 链接 * @param {boolean} useInner - 是否采用内置 JSBridge 打开 @@ -118,6 +119,14 @@ export async function parseLink( } await createPost(postId); return true; + } else if (url.pathname.includes("/topicDetail/")) { + const regex = /\/(\w+)\/topicDetail\/(\d+)/; + const result = url.pathname.match(regex); + if (!result) return false; + const [, game, topicId] = result; + const id = getGameId(game); + await emit("active_deep_link", `router?path=/posts/topic/${id}/${topicId}`); + return true; } } if (url.hostname === "webstatic.mihoyo.com") { diff --git a/src/web/constant/bbs.ts b/src/web/constant/bbs.ts index 6b3c2523..32c3c611 100644 --- a/src/web/constant/bbs.ts +++ b/src/web/constant/bbs.ts @@ -24,24 +24,24 @@ export const BBS_SALT = { /** * @description 频道列表 - * @version 2.72.2 - * @since Beta v0.5.1 + * @since Beta v0.6.5 * @interface ToChannelItem * @property {string} title - 频道名称 * @property {string} icon - 频道图标 * @property {string} gid - 频道 gid + * @property {string} mini - 频道简称 * @return ToChannelItem */ export interface ToChannelItem { title: string; icon: string; gid: string; + mini: string; } /** * @description 渠道列表 - * @version 2.72.2 - * @since Beta v0.5.1 + * @since Beta v0.6.5 * @type {Array} */ export const CHANNEL_LIST: ToChannelItem[] = [ @@ -49,35 +49,42 @@ export const CHANNEL_LIST: ToChannelItem[] = [ title: "原神", icon: "/platforms/mhy/ys.webp", gid: "2", + mini: "ys", }, { title: "崩坏:星穹铁道", icon: "/platforms/mhy/sr.webp", gid: "6", + mini: "sr", }, { title: "绝区零", icon: "/platforms/mhy/zzz.webp", gid: "8", + mini: "zzz", }, { title: "崩坏3", icon: "/platforms/mhy/bh3.webp", gid: "1", + mini: "bh3", }, { title: "崩坏2", icon: "/platforms/mhy/bh2.webp", gid: "3", + mini: "bh2", }, { title: "未定事件簿", icon: "/platforms/mhy/wd.webp", gid: "4", + mini: "wd", }, { title: "大别野", icon: "/platforms/mhy/dby.webp", gid: "5", + mini: "dby", }, ]; diff --git a/src/web/utils/tools.ts b/src/web/utils/tools.ts index 3719e336..59794117 100644 --- a/src/web/utils/tools.ts +++ b/src/web/utils/tools.ts @@ -64,3 +64,13 @@ export function getGameName(gid: number): string { const game = TGConstant.BBS.CHANNELS.find((item) => item.gid === gid.toString()); return game ? game.title : "未知游戏"; } + +/** + * @description 获取游戏id + * @param {string} mini + * @returns {string} + */ +export function getGameId(mini: string): string { + const game = TGConstant.BBS.CHANNELS.find((item) => item.mini === mini); + return game ? game.gid : "0"; +}