prohibit preview when download is not allowed

This commit is contained in:
SiHuan
2021-07-06 19:15:33 +08:00
parent c2ddf2f470
commit 2f24000fb5

View File

@ -26,13 +26,15 @@ func InitApiRouter(engine *gin.Engine, download bool) {
apiV2.GET("/info", controllers.Info)
apiV2.POST("/get", controllers.Get)
apiV2.POST("/path", controllers.Path)
apiV2.POST("/office_preview/:drive", controllers.OfficePreview)
apiV2.POST("/video_preview/:drive", controllers.VideoPreview)
apiV2.POST("/local_search", controllers.LocalSearch)
apiV2.POST("/global_search", controllers.GlobalSearch)
apiV2.POST("/rebuild", controllers.RebuildTree)
}
if download {
apiV2.POST("/office_preview/:drive", controllers.OfficePreview)
apiV2.POST("/video_preview/:drive", controllers.VideoPreview)
engine.GET("/d/*path", controllers.Down)
}
}