change proxy setting

This commit is contained in:
微凉
2021-11-17 17:20:57 +08:00
parent 0b7f2fee7d
commit 3d9746485d
8 changed files with 202 additions and 151 deletions

View File

@ -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
}