This commit is contained in:
Daniel 2025-02-13 15:24:41 +08:00
parent af1dac157e
commit 1dcdab24a7
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
2 changed files with 10 additions and 3 deletions

View file

@ -151,6 +151,10 @@ export const isWin11 = async () => {
return false;
};
export const isWindows = () => {
return navigator.platform.toUpperCase().indexOf("WIN") > -1;
}
export const isInAndroid = () => {
return window.siyuan.config.system.container === "android" && window.JSAndroid;
};

View file

@ -10,7 +10,7 @@ import {Constants} from "../constants";
import {ipcRenderer} from "electron";
/// #endif
import {showMessage} from "../dialog/message";
import {isOnlyMeta, setStorageVal, updateHotkeyTip} from "../protyle/util/compatibility";
import {isOnlyMeta, isWindows, setStorageVal, updateHotkeyTip} from "../protyle/util/compatibility";
import {matchHotKey} from "../protyle/util/hotKey";
import {Menu} from "../plugin/Menu";
import {hasClosestByClassName} from "../protyle/util/hasClosest";
@ -101,8 +101,11 @@ export const isLocalPath = (link: string) => {
return true;
}
const colonIdx = link.indexOf(":");
return 1 === colonIdx; // 冒号前面只有一个字符认为是 Windows 盘符而不是网络协议
if (isWindows()) {
const colonIdx = link.indexOf(":");
return 1 === colonIdx; // 冒号前面只有一个字符认为是 Windows 盘符而不是网络协议
}
return link.startsWith("/")
};
export const pathPosix = () => {