mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-12 09:18:14 +08:00
👽️ 增加 genshinnet 域名处理
This commit is contained in:
@@ -80,12 +80,8 @@ function getTextStyle(): StyleValue {
|
||||
if (data.attributes) {
|
||||
const ruleBold: StyleValue = "fontFamily: var(--font-title)";
|
||||
const ruleItalic: StyleValue = "fontStyle: italic";
|
||||
if (data.attributes.bold) {
|
||||
style.push(ruleBold);
|
||||
}
|
||||
if (data.attributes.italic) {
|
||||
style.push(ruleItalic);
|
||||
}
|
||||
if (data.attributes.bold) style.push(ruleBold);
|
||||
if (data.attributes.italic) style.push(ruleItalic);
|
||||
if (data.attributes.color) {
|
||||
let colorGet = data.attributes.color;
|
||||
if (isColorSimilar("#000000", data.attributes.color)) {
|
||||
@@ -111,11 +107,7 @@ async function toLink() {
|
||||
const res = await parseLink(link);
|
||||
if (res === true) return;
|
||||
if (res === false) {
|
||||
showSnackbar({
|
||||
text: `未知链接:${link}`,
|
||||
color: "error",
|
||||
timeout: 3000,
|
||||
});
|
||||
showSnackbar({ text: `未知链接:${link}`, color: "error", timeout: 3000 });
|
||||
return;
|
||||
}
|
||||
window.open(res);
|
||||
@@ -128,23 +120,17 @@ function getEmojiUrl(): string {
|
||||
getEmojis().then((res) => {
|
||||
if ("retcode" in res) {
|
||||
console.error(res);
|
||||
showSnackbar({
|
||||
text: "获取表情包失败!",
|
||||
color: "error",
|
||||
});
|
||||
showSnackbar({ text: "获取表情包失败!", color: "error" });
|
||||
mode.value = "text";
|
||||
return "";
|
||||
} else {
|
||||
localEmojis.value = JSON.stringify(res);
|
||||
localStorage.setItem("emojis", localEmojis.value);
|
||||
}
|
||||
localEmojis.value = JSON.stringify(res);
|
||||
localStorage.setItem("emojis", localEmojis.value);
|
||||
});
|
||||
}
|
||||
const emojiName = getEmojiName();
|
||||
const emojiMap: Record<string, string> = JSON.parse(<string>localEmojis.value);
|
||||
if (!Object.keys(emojiMap).includes(emojiName)) {
|
||||
mode.value = "text";
|
||||
}
|
||||
if (!Object.keys(emojiMap).includes(emojiName)) mode.value = "text";
|
||||
return JSON.parse(<string>localEmojis.value)[emojiName];
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @file src/utils/linkParser.ts
|
||||
* @description 处理链接
|
||||
* @since Beta v0.5.5
|
||||
* @since Beta v0.6.3
|
||||
*/
|
||||
|
||||
import { emit } from "@tauri-apps/api/event";
|
||||
@@ -56,7 +56,7 @@ export async function parsePost(link: string): Promise<false | string> {
|
||||
|
||||
/**
|
||||
* @function parseLink
|
||||
* @since Beta v0.5.5
|
||||
* @since Beta v0.6.3
|
||||
* @description 处理链接
|
||||
* @param {string} link - 链接
|
||||
* @param {boolean} useInner - 是否采用内置 JSBridge 打开
|
||||
@@ -140,6 +140,7 @@ export async function parseLink(
|
||||
"webstatic.miyoushe.com",
|
||||
"bbs.mihoyo.com",
|
||||
"qaa.miyoushe.com",
|
||||
"mihoyo.genshinnet.com",
|
||||
];
|
||||
if (prefix.includes(url.hostname) && !useInner) {
|
||||
const openCheck = await showConfirm({
|
||||
|
||||
Reference in New Issue
Block a user