🎨 数据历史文档中支持操作类型过滤 https://github.com/siyuan-note/siyuan/issues/5754

This commit is contained in:
Liang Ding 2022-08-30 20:12:26 +08:00
parent a165cac78e
commit 84b0cf7033
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
2 changed files with 16 additions and 10 deletions

View file

@ -204,11 +204,8 @@ func serveAssets(ginServer *gin.Engine) {
http.ServeFile(context.Writer, context.Request, p)
return
})
ginServer.GET("/history/:dir/assets/*name", model.CheckAuth, func(context *gin.Context) {
dir := context.Param("dir")
name := context.Param("name")
relativePath := path.Join(dir, "assets", name)
p := filepath.Join(util.HistoryDir, relativePath)
ginServer.GET("/history/*path", model.CheckAuth, func(context *gin.Context) {
p := filepath.Join(util.HistoryDir, context.Param("path"))
http.ServeFile(context.Writer, context.Request, p)
return
})