🎨 微改

This commit is contained in:
BTMuli
2023-12-29 17:06:15 +08:00
parent 7cd87895af
commit 7a9976f4ec

View File

@@ -1,7 +1,7 @@
/** /**
* @file src/utils/linkParser.ts * @file src/utils/linkParser.ts
* @description 处理链接 * @description 处理链接
* @since Beta v0.3.8 * @since Beta v0.3.9
*/ */
import TGClient from "./TGClient"; import TGClient from "./TGClient";
@@ -48,7 +48,7 @@ export async function parsePost(link: string): Promise<false | string> {
/** /**
* @function parseLink * @function parseLink
* @since Beta v0.3.8 * @since Beta v0.3.9
* @description 处理链接 * @description 处理链接
* @param {string} link - 链接 * @param {string} link - 链接
* @param {boolean} useInner - 是否采用内置 JSBridge 打开 * @param {boolean} useInner - 是否采用内置 JSBridge 打开
@@ -110,24 +110,22 @@ export async function parseLink(
"bbs.mihoyo.com", "bbs.mihoyo.com",
"qaa.miyoushe.com", "qaa.miyoushe.com",
]; ];
if (prefix.includes(url.hostname)) { if (prefix.includes(url.hostname) && !useInner) {
if (!useInner) { const openCheck = await showConfirm({
const openCheck = await showConfirm({ title: "采用内置 JSBridge",
title: "采用内置 JSBridge", text: "取消则使用外部浏览器打开",
text: "取消则使用外部浏览器打开", });
}); if (!openCheck) return url.href;
if (!openCheck) return url.href; const typeCheck = await showConfirm({
const typeCheck = await showConfirm({ title: "采用宽屏模式?",
title: "采用宽屏模式?", text: "取消则使用默认竖屏",
text: "取消则使用默认竖屏", });
}); if (typeCheck) {
if (typeCheck) { await TGClient.open("web_act", link);
await TGClient.open("web_act", link); } else {
} else { await TGClient.open("web_act_thin", link);
await TGClient.open("web_act_thin", link);
}
return true;
} }
return true;
} }
return url.href.toString(); return url.href.toString();
} }