浏览代码

:art: Improve exporting HTML/Word

Daniel 6 月之前
父节点
当前提交
25f934ecb4
共有 2 个文件被更改,包括 2 次插入5 次删除
  1. 2 4
      kernel/model/export.go
  2. 0 1
      kernel/model/session.go

+ 2 - 4
kernel/model/export.go

@@ -711,13 +711,12 @@ func ExportMarkdownHTML(id, savePath string, docx, merge bool) (name, dom string
 		}
 	}
 
-	srcs := []string{"stage/build/export", "stage/build/fonts", "stage/protyle"}
+	srcs := []string{"stage/build/export", "stage/protyle"}
 	for _, src := range srcs {
 		from := filepath.Join(util.WorkingDir, src)
 		to := filepath.Join(savePath, src)
 		if err := filelock.Copy(from, to); err != nil {
 			logging.LogWarnf("copy stage from [%s] to [%s] failed: %s", from, savePath, err)
-			return
 		}
 	}
 
@@ -869,7 +868,7 @@ func ExportHTML(id, savePath string, pdf, image, keepFold, merge bool) (name, do
 	}
 
 	if !pdf && "" != savePath { // 导出 HTML 需要复制静态资源
-		srcs := []string{"stage/build/export", "stage/build/fonts", "stage/protyle"}
+		srcs := []string{"stage/build/export", "stage/protyle"}
 		for _, src := range srcs {
 			from := filepath.Join(util.WorkingDir, src)
 			to := filepath.Join(savePath, src)
@@ -899,7 +898,6 @@ func ExportHTML(id, savePath string, pdf, image, keepFold, merge bool) (name, do
 			to := filepath.Join(savePath, "appearance", src)
 			if err := filelock.Copy(from, to); err != nil {
 				logging.LogErrorf("copy appearance from [%s] to [%s] failed: %s", from, savePath, err)
-				return
 			}
 		}
 

+ 0 - 1
kernel/model/session.go

@@ -214,7 +214,6 @@ func CheckAuth(c *gin.Context) {
 	// 放过 /appearance/
 	if strings.HasPrefix(c.Request.RequestURI, "/appearance/") ||
 		strings.HasPrefix(c.Request.RequestURI, "/stage/build/export/") ||
-		strings.HasPrefix(c.Request.RequestURI, "/stage/build/fonts/") ||
 		strings.HasPrefix(c.Request.RequestURI, "/stage/protyle/") {
 		c.Next()
 		return