mirror of
https://github.com/OpenListTeam/OpenList.git
synced 2025-09-19 20:26:26 +08:00
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:
@ -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
|
||||
|
Reference in New Issue
Block a user