mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-12 09:18:14 +08:00
🎨 微改
*侧边栏酒馆 → 帖子 *完善对于 protocol 的判断
This commit is contained in:
@@ -10,6 +10,7 @@ import showConfirm from "../components/func/confirm";
|
||||
|
||||
/**
|
||||
* @function parseLink
|
||||
* @since Beta v0.3.8
|
||||
* @description 处理链接
|
||||
* @param {string} link - 链接
|
||||
* @param {boolean} useInner - 是否采用内置 JSBridge 打开
|
||||
@@ -19,9 +20,8 @@ export async function parseLink(
|
||||
link: string,
|
||||
useInner: boolean = false,
|
||||
): Promise<boolean | string> {
|
||||
console.warn("parseLink", link);
|
||||
const url = new URL(link);
|
||||
if (url.protocol !== "https:") {
|
||||
if (url.protocol !== "https:" && url.protocol !== "http:") {
|
||||
if (url.protocol === "mihoyobbs:") {
|
||||
if (url.pathname.startsWith("//article/")) {
|
||||
const postId = url.pathname.split("/").pop();
|
||||
|
||||
Reference in New Issue
Block a user