feat: add aliyundrive open driver (#3437)

close #3533 
close #3521 
close #3459 
close #3375 

* feat: add aliyundrive open driver

* feat: adapt alist api

* fix: trailing spaces

* feat(aliyundrive_open): video preview api
This commit is contained in:
Andy Hsu
2023-02-23 20:45:57 +08:00
committed by GitHub
parent de3ea82eb9
commit 28aee8c493
7 changed files with 440 additions and 3 deletions

View File

@ -19,9 +19,9 @@ func Init(e *gin.Engine) {
c.Redirect(302, conf.URL.Path)
})
}
Cors(e)
g := e.Group(conf.URL.Path)
common.SecretKey = []byte(conf.Conf.JwtSecret)
Cors(g)
g.Use(middlewares.StoragesLoaded)
if conf.Conf.MaxConnections > 0 {
g.Use(middlewares.MaxAllowed(conf.Conf.MaxConnections))
@ -133,7 +133,7 @@ func _fs(g *gin.RouterGroup) {
g.POST("/add_qbit", handles.AddQbittorrent)
}
func Cors(r *gin.RouterGroup) {
func Cors(r *gin.Engine) {
config := cors.DefaultConfig()
config.AllowAllOrigins = true
config.AllowHeaders = []string{"*"}