This commit is contained in:
parent
c5f0bcd71c
commit
d4de553a09
2 changed files with 9 additions and 12 deletions
4
app/pnpm-lock.yaml
generated
4
app/pnpm-lock.yaml
generated
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
} 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("/", "\\");
|
||||
}
|
||||
}
|
||||
|
||||
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://", "");
|
||||
}
|
||||
if (type === "app") {
|
||||
shell.openPath(address);
|
||||
} else if (type === "folder") {
|
||||
|
|
Loading…
Add table
Reference in a new issue