mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-14 09:38:13 +08:00
♻️ 优化代码
This commit is contained in:
@@ -88,10 +88,7 @@ async function toLink() {
|
||||
post_id: link.split("/").pop(),
|
||||
},
|
||||
});
|
||||
} else if (
|
||||
link.startsWith("https://webstatic.mihoyo.com/ys/event/e20220303-birthday/") ||
|
||||
link.startsWith("https://act.mihoyo.com")
|
||||
) {
|
||||
} else if (isMysAct(link)) {
|
||||
const resOpen = await showConfirm({
|
||||
title: "采用内置 JSBridge?",
|
||||
text: "取消则使用外部浏览器打开",
|
||||
@@ -114,6 +111,15 @@ async function toLink() {
|
||||
}
|
||||
}
|
||||
|
||||
function isMysAct(url: string): boolean {
|
||||
// link.startsWith("https://webstatic.mihoyo.com/ys/event/e20220303-birthday/")
|
||||
if (url.startsWith("https://act.mihoyo.com")) return true;
|
||||
if (url.startsWith("https://webstatic.mihoyo.com")) {
|
||||
return url.includes("event");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// 解析表情链接
|
||||
function getEmojiUrl(): string {
|
||||
let emojis = localStorage.getItem("emojis");
|
||||
|
||||
Reference in New Issue
Block a user