diff --git a/drivers/123/driver.go b/drivers/123/driver.go index 0277be40..989c9c77 100644 --- a/drivers/123/driver.go +++ b/drivers/123/driver.go @@ -297,6 +297,7 @@ type UploadResp struct { // TODO unfinished func (driver Pan123) Upload(file *model.FileStream, account *model.Account) error { + return base.ErrNotImplement parentFile, err := driver.File(file.ParentPath, account) if err != nil { return err diff --git a/drivers/189/driver.go b/drivers/189/driver.go index 30e25dbe..87f4bc9b 100644 --- a/drivers/189/driver.go +++ b/drivers/189/driver.go @@ -359,6 +359,7 @@ func (driver Cloud189) Delete(path string, account *model.Account) error { // Upload Error: decrypt encryptionText failed func (driver Cloud189) Upload(file *model.FileStream, account *model.Account) error { + return base.ErrNotImplement const DEFAULT uint64 = 10485760 var count = int64(math.Ceil(float64(file.GetSize()) / float64(DEFAULT))) var finish uint64 = 0 diff --git a/drivers/google/driver.go b/drivers/google/driver.go index e7ae231f..3035f527 100644 --- a/drivers/google/driver.go +++ b/drivers/google/driver.go @@ -259,9 +259,13 @@ func (driver GoogleDrive) Upload(file *model.FileStream, account *model.Account) "parents": []string{parentFile.Id}, } var e Error + url := "https://www.googleapis.com/upload/drive/v3/files?uploadType=resumable&supportsAllDrives=true" + if account.APIProxyUrl != "" { + url = fmt.Sprintf("%s/%s", account.APIProxyUrl, url) + } res, err := base.NoRedirectClient.R().SetHeader("Authorization", "Bearer "+account.AccessToken). SetError(&e).SetBody(data). - Post("https://www.googleapis.com/upload/drive/v3/files?uploadType=resumable&supportsAllDrives=true") + Post(url) if err != nil { return err }