mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-28 12:28:48 +01:00
🐛 Fix local file open issue https://github.com/siyuan-note/siyuan/issues/14052
This commit is contained in:
parent
af1dac157e
commit
1dcdab24a7
2 changed files with 10 additions and 3 deletions
|
|
@ -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;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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 = () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue