mirror of https://github.com/Xhofe/alist
✨ proxy add account
parent
36d52e0b75
commit
0b7f2fee7d
|
@ -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")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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/")
|
||||||
}
|
}
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue