mirror of
https://github.com/OpenListTeam/OpenList.git
synced 2025-09-19 20:26:26 +08:00
fixed(drive):Delete old Dropbox renewapi (#296)
* add dropbox api * fixed(api):Delete old dropbox renew api --------- Signed-off-by: Suyunmeng <69945917+Suyunmeng@users.noreply.github.com> Co-authored-by: pikachuim <pikachuim@qq.com>
This commit is contained in:
@ -5,10 +5,6 @@ import (
|
|||||||
"github.com/OpenListTeam/OpenList/internal/op"
|
"github.com/OpenListTeam/OpenList/internal/op"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
|
||||||
DefaultClientID = "76lrwrklhdn1icb"
|
|
||||||
)
|
|
||||||
|
|
||||||
type Addition struct {
|
type Addition struct {
|
||||||
driver.RootPath
|
driver.RootPath
|
||||||
UseOnlineAPI bool `json:"use_online_api" default:"true"`
|
UseOnlineAPI bool `json:"use_online_api" default:"true"`
|
||||||
|
@ -28,7 +28,7 @@ func (d *Dropbox) refreshToken() error {
|
|||||||
SetQueryParams(map[string]string{
|
SetQueryParams(map[string]string{
|
||||||
"refresh_ui": d.RefreshToken,
|
"refresh_ui": d.RefreshToken,
|
||||||
"server_use": "true",
|
"server_use": "true",
|
||||||
"driver_txt": "baiduyun_go",
|
"driver_txt": "dropboxs_go",
|
||||||
}).
|
}).
|
||||||
Get(u)
|
Get(u)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -46,9 +46,6 @@ func (d *Dropbox) refreshToken() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
url := d.base + "/oauth2/token"
|
url := d.base + "/oauth2/token"
|
||||||
if utils.SliceContains([]string{"", DefaultClientID}, d.ClientID) {
|
|
||||||
url = d.APIAddress
|
|
||||||
}
|
|
||||||
var tokenResp TokenResp
|
var tokenResp TokenResp
|
||||||
resp, err := base.RestyClient.R().
|
resp, err := base.RestyClient.R().
|
||||||
//ForceContentType("application/x-www-form-urlencoded").
|
//ForceContentType("application/x-www-form-urlencoded").
|
||||||
|
Reference in New Issue
Block a user