mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2026-03-31 06:29:46 +08:00
👽️ 增加 genshinnet 域名处理
This commit is contained in:
@@ -78,12 +78,15 @@
|
||||
},
|
||||
{
|
||||
"url": "https://*.mihoyo.com/*"
|
||||
},
|
||||
{
|
||||
"url": "https://*.genshinnet.com/*"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"remote": {
|
||||
"urls": ["https://*.mihoyo.com/*", "https://*.miyoushe.com/*"]
|
||||
"urls": ["https://*.mihoyo.com/*", "https://*.miyoushe.com/*", "https://*.genshinnet.com/*"]
|
||||
},
|
||||
"platforms": ["windows", "macOS"]
|
||||
}
|
||||
|
||||
@@ -78,6 +78,9 @@
|
||||
},
|
||||
{
|
||||
"url": "https://*.hoyoverse.com/*"
|
||||
},
|
||||
{
|
||||
"url": "https://*.genshinnet.com/*"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -41,7 +41,9 @@
|
||||
"Mys": {
|
||||
"identifier": "Mys",
|
||||
"description": "Capability for the mys client window",
|
||||
"remote": { "urls": ["https://*.mihoyo.com/*", "https://*.miyoushe.com/*"] },
|
||||
"remote": {
|
||||
"urls": ["https://*.mihoyo.com/*", "https://*.miyoushe.com/*", "https://*.genshinnet.com/*"]
|
||||
},
|
||||
"local": true,
|
||||
"windows": ["mhy_client"],
|
||||
"permissions": [
|
||||
@@ -64,7 +66,11 @@
|
||||
{ "identifier": "fs:allow-write-text-file", "allow": [{ "path": "**" }] },
|
||||
{
|
||||
"identifier": "http:default",
|
||||
"allow": [{ "url": "https://*.miyoushe.com/*" }, { "url": "https://*.mihoyo.com/*" }]
|
||||
"allow": [
|
||||
{ "url": "https://*.miyoushe.com/*" },
|
||||
{ "url": "https://*.mihoyo.com/*" },
|
||||
{ "url": "https://*.genshinnet.com/*" }
|
||||
]
|
||||
}
|
||||
],
|
||||
"platforms": ["windows", "macOS"]
|
||||
@@ -118,7 +124,8 @@
|
||||
{ "url": "https://*.mihoyo.com/*" },
|
||||
{ "url": "https://*.mihoyogift.com/*" },
|
||||
{ "url": "https://*.bilibili.com/*" },
|
||||
{ "url": "https://*.hoyoverse.com/*" }
|
||||
{ "url": "https://*.hoyoverse.com/*" },
|
||||
{ "url": "https://*.genshinnet.com/*" }
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
@@ -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