proxy add account

pull/548/head
微凉 2021-11-17 16:37:12 +08:00
parent 36d52e0b75
commit 0b7f2fee7d
5 changed files with 5 additions and 5 deletions

View File

@ -230,7 +230,7 @@ func (c Cloud189) Link(path string, account *model.Account) (string, error) {
return resp.FileDownloadUrl, nil return resp.FileDownloadUrl, nil
} }
func (c Cloud189) Proxy(ctx *gin.Context) { func (c Cloud189) Proxy(ctx *gin.Context, account *model.Account) {
ctx.Request.Header.Del("Origin") ctx.Request.Header.Del("Origin")
} }

View File

@ -103,7 +103,7 @@ func (a AliDrive) Items() []Item {
} }
} }
func (a AliDrive) Proxy(c *gin.Context) { func (a AliDrive) Proxy(c *gin.Context, account *model.Account) {
c.Request.Header.Del("Origin") c.Request.Header.Del("Origin")
c.Request.Header.Set("Referer", "https://www.aliyundrive.com/") c.Request.Header.Set("Referer", "https://www.aliyundrive.com/")
} }

View File

@ -12,7 +12,7 @@ type Driver interface {
Save(account *model.Account, old *model.Account) error Save(account *model.Account, old *model.Account) error
Path(path string, account *model.Account) (*model.File, []*model.File, error) Path(path string, account *model.Account) (*model.File, []*model.File, error)
Link(path string, account *model.Account) (string, error) Link(path string, account *model.Account) (string, error)
Proxy(c *gin.Context) Proxy(c *gin.Context, account *model.Account)
Preview(path string, account *model.Account) (interface{}, error) Preview(path string, account *model.Account) (interface{}, error)
// TODO // TODO
//Search(path string, keyword string, account *model.Account) ([]*model.File, error) //Search(path string, keyword string, account *model.Account) ([]*model.File, error)

View File

@ -31,7 +31,7 @@ func (n Native) Items() []Item {
} }
} }
func (n Native) Proxy(c *gin.Context) { func (n Native) Proxy(c *gin.Context, account *model.Account) {
// unnecessary // unnecessary
} }

View File

@ -301,7 +301,7 @@ func (o Onedrive) Save(account *model.Account, old *model.Account) error {
return nil return nil
} }
func (o Onedrive) Proxy(c *gin.Context) { func (o Onedrive) Proxy(c *gin.Context, account *model.Account) {
c.Request.Header.Del("Origin") c.Request.Header.Del("Origin")
} }