@@ -10,8 +10,8 @@ import (
|
|||||||
// refresh access_token token by refresh_token
|
// refresh access_token token by refresh_token
|
||||||
func RefreshToken(drive *conf.Drive) bool {
|
func RefreshToken(drive *conf.Drive) bool {
|
||||||
log.Infof("刷新[%s]token...", drive.Name)
|
log.Infof("刷新[%s]token...", drive.Name)
|
||||||
url := "https://websv.aliyundrive.com/token/refresh"
|
url := "https://auth.aliyundrive.com/v2/account/token"
|
||||||
req := RefreshTokenReq{RefreshToken: drive.RefreshToken}
|
req := RefreshTokenReq{RefreshToken: drive.RefreshToken , GrantType: "refresh_token"}
|
||||||
var token TokenResp
|
var token TokenResp
|
||||||
if body, err := DoPost(url, req, ""); err != nil {
|
if body, err := DoPost(url, req, ""); err != nil {
|
||||||
log.Errorf("tokenLogin-doPost出错:%s", err.Error())
|
log.Errorf("tokenLogin-doPost出错:%s", err.Error())
|
||||||
|
@@ -57,6 +57,7 @@ type GetTokenReq struct {
|
|||||||
// refresh_token request bean
|
// refresh_token request bean
|
||||||
type RefreshTokenReq struct {
|
type RefreshTokenReq struct {
|
||||||
RefreshToken string `json:"refresh_token"`
|
RefreshToken string `json:"refresh_token"`
|
||||||
|
GrantType string `json:"grant_type"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// office_preview_url request bean
|
// office_preview_url request bean
|
||||||
@@ -70,4 +71,4 @@ type OfficePreviewUrlReq struct {
|
|||||||
type VideoPreviewUrlReq struct {
|
type VideoPreviewUrlReq struct {
|
||||||
DriveId string `json:"drive_id"`
|
DriveId string `json:"drive_id"`
|
||||||
FileId string `json:"file_id"`
|
FileId string `json:"file_id"`
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user