|
@@ -472,7 +472,7 @@ export const openBy = (url: string, type: "folder" | "app") => {
|
|
|
let address = "";
|
|
|
if ("windows" === window.siyuan.config.system.os) {
|
|
|
// `file://` 协议兼容 Window 平台使用 `/` 作为目录分割线 https://github.com/siyuan-note/siyuan/issues/5681
|
|
|
- address = url.replace("file:///", "").replace("file://\\", "").replace("file://", "").replace("/", "\\");
|
|
|
+ address = url.replace("file:///", "").replace("file://\\", "").replace("file://", "").replace(/\//g, "\\");
|
|
|
} else {
|
|
|
address = url.replace("file://", "");
|
|
|
}
|
|
@@ -482,8 +482,10 @@ export const openBy = (url: string, type: "folder" | "app") => {
|
|
|
shell.openPath(address);
|
|
|
} else if (type === "folder") {
|
|
|
if ("windows" === window.siyuan.config.system.os) {
|
|
|
- // Windows 端打开本地文件所在位置失效 https://github.com/siyuan-note/siyuan/issues/5808
|
|
|
- address = address.replace(/\\\\/g, "\\");
|
|
|
+ if (!address.startsWith("\\\\")) { // \\ 开头的路径是 Windows 网络共享路径 https://github.com/siyuan-note/siyuan/issues/5980
|
|
|
+ // Windows 端打开本地文件所在位置失效 https://github.com/siyuan-note/siyuan/issues/5808
|
|
|
+ address = address.replace(/\\\\/g, "\\");
|
|
|
+ }
|
|
|
}
|
|
|
shell.showItemInFolder(address);
|
|
|
}
|