refactor: init v3

This commit is contained in:
Noah Hsu
2022-06-06 16:28:37 +08:00
parent eb15bce24b
commit b76060570e
185 changed files with 14 additions and 30438 deletions

View File

@ -1,32 +0,0 @@
package controllers
import (
"github.com/Xhofe/alist/conf"
"github.com/Xhofe/alist/drivers/base"
"github.com/Xhofe/alist/server/common"
"github.com/Xhofe/alist/utils"
"github.com/gin-gonic/gin"
log "github.com/sirupsen/logrus"
)
func Down(c *gin.Context) {
rawPath := c.Param("path")
rawPath = utils.ParsePath(rawPath)
log.Debugf("down: %s", rawPath)
account, path_, driver, err := common.ParsePath(rawPath)
if err != nil {
common.ErrorResp(c, err, 500)
return
}
if driver.Config().OnlyProxy || account.Proxy || utils.IsContain(conf.DProxyTypes, utils.Ext(rawPath)) {
Proxy(c)
return
}
link, err := driver.Link(base.Args{Path: path_, IP: c.ClientIP()}, account)
if err != nil {
common.ErrorResp(c, err, 500)
return
}
c.Redirect(302, link.Url)
return
}