This commit is contained in:
邹宗楠
2022-11-01 16:36:14 +08:00
parent ea7ecfa47b
commit 8c77efb38b
4 changed files with 23 additions and 14 deletions

View File

@@ -110,10 +110,6 @@ func (a *API) RefreshToken() (*doudian_sdk.CreateTokenData, error) {
func (a *API) SetToken(token string) {
a.locker.Lock()
defer a.locker.Unlock()
var access *doudian_sdk.AccessToken
if err := json.Unmarshal([]byte(token), &access); err != nil {
return
}
a.accessToken = token
}
@@ -123,6 +119,18 @@ func (a *API) SetRefreshToken(token string) {
a.refreshToken = token
}
func (a *API) SetExpiresIn(expiresIn int64) {
a.locker.Lock()
defer a.locker.Unlock()
a.expiresIn = expiresIn
}
func (a *API) SetAcctokenObj(acctokenObj *doudian_sdk.AccessToken) {
a.locker.Lock()
defer a.locker.Unlock()
a.accessTokenObj = acctokenObj
}
// GetAppId 获取appid
func (a *API) GetAppId() string {
a.locker.Lock()