chore:Change Logo URL and fixed aliyundrive open bugs (#208)

* Fix Logo URL

* fixed aliyunpan_open

* fixed aliyundrive bugs

* fixed onlineapi bugs

* fixed onlineapi bugs

* Fixed Bugs

* Rollback

* fixed

* fixed onlineapi

* fixed driver

---------

Signed-off-by: Suyunmeng <sumengjing@outlook.com>
This commit is contained in:
Suyunmeng
2025-06-19 21:20:29 +08:00
committed by GitHub
parent 0f8545133b
commit a3c7cb059d
6 changed files with 11 additions and 15 deletions

View File

@ -20,8 +20,7 @@ import (
// do others that not defined in Driver interface
func (d *AliyundriveOpen) _refreshToken() (string, string, error) {
// 使用在线API刷新Token无需ClientID和ClientSecret
if d.UseOnlineAPI && len(d.APIAddress) > 0 {
if d.UseOnlineAPI && d.APIAddress != "" {
u := d.APIAddress
var resp struct {
RefreshToken string `json:"refresh_token"`
@ -45,16 +44,13 @@ func (d *AliyundriveOpen) _refreshToken() (string, string, error) {
}
return "", "", fmt.Errorf("empty token returned from official API")
}
d.AccessToken = resp.AccessToken
d.RefreshToken = resp.RefreshToken
op.MustSaveDriverStorage(d)
return "", "", nil
return resp.RefreshToken, resp.AccessToken, nil
}
// 使用本地客户端的情况下检查是否为空
// 本地刷新逻辑,必须要求 client_id 和 client_secret
if d.ClientID == "" || d.ClientSecret == "" {
return "", "", fmt.Errorf("empty ClientID or ClientSecret")
}
// 走原有的刷新逻辑
url := API_URL + "/oauth/access_token"
//var resp base.TokenResp
var e ErrResp