Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: https://github.com/siyuan-note/siyuan/issues/5681

Vanessad4de553a09ea
diff --git a/app/pnpm-lock.yaml b/app/pnpm-lock.yaml
index a743c6c262..21f1e720c4 100644
--- a/app/pnpm-lock.yaml
+++ b/app/pnpm-lock.yaml
@@ -1906,10 +1906,10 @@ packages:
resolution: {integrity: sha512-mi4DG3m32cMJ5CtO9iYk41gBvGWLzJjQsaQgGOd4ZhmIuKyj8M/0rT1g0s/0qD4Tw8jsa//NXMXCC7vpGIfkTg==}
engines: {node: '>=14.0.0'}
dependencies:
- 7zip-bin: 5.1.1
'@develar/schema-utils': 2.6.5
'@electron/universal': 1.2.1
'@malept/flatpak-bundler': 0.4.0
+ 7zip-bin: 5.1.1
async-exit-hook: 2.0.1
bluebird-lst: 1.0.9
builder-util: 23.3.0
@@ -2193,9 +2193,9 @@ packages:
/builder-util/23.3.0:
resolution: {integrity: sha512-m7RRd21N2yrnuGFd+ZqOY0ryeqWmBslDKmGDVz0wETqoEEqpiJsF3CGlsb6MRN2EQKDubvE5e+lBf8ATt06fnA==}
dependencies:
- 7zip-bin: 5.1.1
'@types/debug': 4.1.7
'@types/fs-extra': 9.0.13
+ 7zip-bin: 5.1.1
app-builder-bin: 4.0.0
bluebird-lst: 1.0.9
builder-util-runtime: 9.0.3
diff --git a/app/src/editor/util.ts b/app/src/editor/util.ts
index 686a97bde8..c0024adbb7 100644
--- a/app/src/editor/util.ts
+++ b/app/src/editor/util.ts
@@ -436,7 +436,6 @@ export const updateBacklinkGraph = (models: IModels, protyle: IProtyle) => {
export const openBy = (url: string, type: "folder" | "app") => {
/// #if !BROWSER
- let address;
if (url.startsWith("assets/")) {
fetchPost("/api/asset/resolveAssetPath", {path: url.replace(/\.pdf\?page=\d{1,}$/, ".pdf")}, (response) => {
if (type === "app") {
@@ -446,16 +445,14 @@ export const openBy = (url: string, type: "folder" | "app") => {
}
});
return;
+ }
+ 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("/", "\\");
} else {
- address = url.replace("file:///", "")
- .replace("file://\\", "")
- .replace("file://", "");
- if ("windows" === window.siyuan.config.system.os) {
- // `file://` 协议兼容 Window 平台使用 `/` 作为目录分割线 https://github.com/siyuan-note/siyuan/issues/5681
- address = address.replace("/", "\\");
- }
+ address = url.replace("file://", "");
}
-
if (type === "app") {
shell.openPath(address);
} else if (type === "folder") {