🍃 Optimization download config
This commit is contained in:
@ -2,6 +2,7 @@ package controllers
|
||||
|
||||
import (
|
||||
"github.com/Xhofe/alist/alidrive"
|
||||
"github.com/Xhofe/alist/conf"
|
||||
"github.com/Xhofe/alist/utils"
|
||||
"github.com/gin-gonic/gin"
|
||||
log "github.com/sirupsen/logrus"
|
||||
@ -13,6 +14,10 @@ type OfficePreviewReq struct {
|
||||
|
||||
// handle office_preview request
|
||||
func OfficePreview(c *gin.Context) {
|
||||
if !conf.Conf.Server.Download {
|
||||
c.JSON(200,MetaResponse(403,"not allowed download and preview"))
|
||||
return
|
||||
}
|
||||
drive := utils.GetDriveByName(c.Param("drive"))
|
||||
if drive == nil {
|
||||
c.JSON(200, MetaResponse(400, "drive isn't exist."))
|
||||
|
Reference in New Issue
Block a user