perf(aliyundrive_open): don't refresh token on init if token valid

This commit is contained in:
Andy Hsu
2023-03-20 15:00:02 +08:00
parent cefec1a663
commit aeb48b2ecc
2 changed files with 2 additions and 6 deletions

View File

@ -20,8 +20,7 @@ type AliyundriveOpen struct {
Addition
base string
AccessToken string
DriveId string
DriveId string
}
func (d *AliyundriveOpen) Config() driver.Config {
@ -33,10 +32,6 @@ func (d *AliyundriveOpen) GetAddition() driver.Additional {
}
func (d *AliyundriveOpen) Init(ctx context.Context) error {
err := d.refreshToken()
if err != nil {
return err
}
res, err := d.request("/adrive/v1.0/user/getDriveInfo", http.MethodPost, nil)
if err != nil {
return err