Merge pull request #119 from sihuan/transonly

prohibit preview when download is not allowed
This commit is contained in:
微凉
2021-07-07 07:56:35 +08:00
committed by GitHub

View File

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