mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 17:41:57 +08:00
Fix: policy should be re-dispatch while getting thumbnails
This commit is contained in:
@@ -115,6 +115,23 @@ func SlavePreview(c *gin.Context) {
|
||||
}
|
||||
}
|
||||
|
||||
// SlaveThumb 从机文件缩略图
|
||||
func SlaveThumb(c *gin.Context) {
|
||||
// 创建上下文
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
defer cancel()
|
||||
|
||||
var service explorer.SlaveFileService
|
||||
if err := c.ShouldBindUri(&service); err == nil {
|
||||
res := service.Thumb(ctx, c)
|
||||
if res.Code != 0 {
|
||||
c.JSON(200, res)
|
||||
}
|
||||
} else {
|
||||
c.JSON(200, ErrorResponse(err))
|
||||
}
|
||||
}
|
||||
|
||||
// SlaveDelete 从机删除
|
||||
func SlaveDelete(c *gin.Context) {
|
||||
// 创建上下文
|
||||
|
||||
@@ -39,6 +39,8 @@ func InitSlaveRouter() *gin.Engine {
|
||||
v3.GET("download/:speed/:path/:name", controllers.SlaveDownload)
|
||||
// 预览 / 外链
|
||||
v3.GET("source/:speed/:path/:name", controllers.SlavePreview)
|
||||
// 缩略图
|
||||
v3.GET("thumb/:path", controllers.SlaveThumb)
|
||||
// 删除文件
|
||||
v3.POST("delete", controllers.SlaveDelete)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user