浏览代码

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

Vanessa 2 年之前
父节点
当前提交
d982fd1dde
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      app/src/protyle/toolbar/util.ts

+ 1 - 1
app/src/protyle/toolbar/util.ts

@@ -1,7 +1,7 @@
 import {fetchPost} from "../../util/fetch";
 
 export const previewTemplate = (pathString: string, element: Element) => {
-    fetchPost("/api/file/getFile", {path: pathString.replace(window.siyuan.config.system.dataDir, "")}, (response) => {
+    fetchPost("/api/file/getFile", {path: pathString.replace(window.siyuan.config.system.dataDir.substring(0, window.siyuan.config.system.dataDir.length - 4), "")}, (response) => {
         element.innerHTML = response.data;
     })
 }