✨ change proxy setting
This commit is contained in:
@ -29,6 +29,13 @@ var client189Map map[string]*resty.Client
|
||||
|
||||
func (c Cloud189) Items() []Item {
|
||||
return []Item{
|
||||
{
|
||||
Name: "proxy",
|
||||
Label: "proxy",
|
||||
Type: "bool",
|
||||
Required: true,
|
||||
Description: "allow proxy",
|
||||
},
|
||||
{
|
||||
Name: "username",
|
||||
Label: "username",
|
||||
@ -224,6 +231,9 @@ func (c Cloud189) Link(path string, account *model.Account) (string, error) {
|
||||
return "", fmt.Errorf(resp.ResMessage)
|
||||
}
|
||||
res, err := noRedirectClient.R().Get(resp.FileDownloadUrl)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
if res.StatusCode() == 302 {
|
||||
return res.Header().Get("location"), nil
|
||||
}
|
||||
|
@ -67,6 +67,13 @@ func (a AliDrive) Preview(path string, account *model.Account) (interface{}, err
|
||||
|
||||
func (a AliDrive) Items() []Item {
|
||||
return []Item{
|
||||
{
|
||||
Name: "proxy",
|
||||
Label: "proxy",
|
||||
Type: "bool",
|
||||
Required: true,
|
||||
Description: "allow proxy",
|
||||
},
|
||||
{
|
||||
Name: "order_by",
|
||||
Label: "order_by",
|
||||
|
@ -43,6 +43,7 @@ func (n Native) Save(account *model.Account, old *model.Account) error {
|
||||
return fmt.Errorf("[%s] not exist", account.RootFolder)
|
||||
}
|
||||
account.Status = "work"
|
||||
account.Proxy = true
|
||||
err := model.SaveAccount(account)
|
||||
if err != nil {
|
||||
return err
|
||||
|
@ -77,6 +77,13 @@ func (o Onedrive) GetMetaUrl(account *model.Account, auth bool, path string) str
|
||||
|
||||
func (o Onedrive) Items() []Item {
|
||||
return []Item{
|
||||
{
|
||||
Name: "proxy",
|
||||
Label: "proxy",
|
||||
Type: "bool",
|
||||
Required: true,
|
||||
Description: "allow proxy",
|
||||
},
|
||||
{
|
||||
Name: "zone",
|
||||
Label: "zone",
|
||||
|
Reference in New Issue
Block a user