瀏覽代碼

:art: If a file with the same name exists during export PDF/Docx, it will be automatically renamed https://github.com/siyuan-note/siyuan/issues/11357

Daniel 1 年之前
父節點
當前提交
2456b3fd07
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      kernel/api/export.go

+ 5 - 1
kernel/api/export.go

@@ -412,13 +412,17 @@ func exportDocx(c *gin.Context) {
 	if nil != arg["merge"] {
 		merge = arg["merge"].(bool)
 	}
-	err := model.ExportDocx(id, savePath, removeAssets, merge)
+
+	fullPath, err := model.ExportDocx(id, savePath, removeAssets, merge)
 	if nil != err {
 		ret.Code = -1
 		ret.Msg = err.Error()
 		ret.Data = map[string]interface{}{"closeTimeout": 7000}
 		return
 	}
+	ret.Data = map[string]interface{}{
+		"path": fullPath,
+	}
 }
 
 func exportMdHTML(c *gin.Context) {