🚧 support proxy url

This commit is contained in:
微凉
2021-12-08 10:33:26 +08:00
parent b8698700ef
commit 190c8001a5
11 changed files with 45 additions and 13 deletions

View File

@ -101,7 +101,7 @@ func (driver Alist) Link(path string, account *model.Account) (string, error) {
if utils.GetFileType(filepath.Ext(path)) == conf.TEXT {
flag = "p"
}
return fmt.Sprintf("%s/%s%s?sign=%s", account.SiteUrl, flag, path, utils.Get16MD5Encode(fmt.Sprintf("%s-%s", conf.Token, name))), nil
return fmt.Sprintf("%s/%s%s?sign=%s", account.SiteUrl, flag, path, utils.SignWithToken(name,conf.Token)), nil
}
func (driver Alist) Path(path string, account *model.Account) (*model.File, []model.File, error) {

View File

@ -9,8 +9,9 @@ import (
)
type DriverConfig struct {
Name string
OnlyProxy bool
Name string
OnlyProxy bool
NeedHeader bool
}
type Driver interface {

View File

@ -15,8 +15,9 @@ type GoogleDrive struct{}
func (driver GoogleDrive) Config() base.DriverConfig {
return base.DriverConfig{
Name: "GoogleDrive",
OnlyProxy: true,
Name: "GoogleDrive",
OnlyProxy: true,
NeedHeader: true,
}
}