mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-13 09:28:14 +08:00
⚡️ 链接解析调整
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @file src/utils/linkParser.ts
|
||||
* @description 处理链接
|
||||
* @since Beta v0.4.7
|
||||
* @since Beta v0.5.0
|
||||
*/
|
||||
|
||||
import { emit } from "@tauri-apps/api/event";
|
||||
@@ -52,7 +52,7 @@ export async function parsePost(link: string): Promise<false | string> {
|
||||
|
||||
/**
|
||||
* @function parseLink
|
||||
* @since Beta v0.4.7
|
||||
* @since Beta v0.5.0
|
||||
* @description 处理链接
|
||||
* @param {string} link - 链接
|
||||
* @param {boolean} useInner - 是否采用内置 JSBridge 打开
|
||||
@@ -68,7 +68,7 @@ export async function parseLink(
|
||||
if (url.pathname.startsWith("//article/")) {
|
||||
const postId = url.pathname.split("/").pop();
|
||||
if (!postId) return false;
|
||||
createPost(postId);
|
||||
await createPost(postId);
|
||||
return true;
|
||||
}
|
||||
if (url.pathname === "//webview" && url.search.startsWith("?link=")) {
|
||||
@@ -104,7 +104,7 @@ export async function parseLink(
|
||||
if (!useInner) {
|
||||
return "post";
|
||||
}
|
||||
createPost(postId);
|
||||
await createPost(postId);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user