1
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package tiktok_api
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
doudian_sdk "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/core"
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
"time"
|
||||
@@ -16,7 +17,17 @@ type Api struct {
|
||||
expiresIn int64
|
||||
}
|
||||
|
||||
func New(appKey, appSecret string) *Api {
|
||||
func New(appKey, appSecret, accessToken string) *Api {
|
||||
var access *doudian_sdk.AccessToken
|
||||
if accessToken != "" {
|
||||
if err := json.Unmarshal([]byte(accessToken), &access); err != nil {
|
||||
globals.SugarLogger.Debug("accessToken init err :", err)
|
||||
return nil
|
||||
} else {
|
||||
AccessToken = access
|
||||
}
|
||||
}
|
||||
|
||||
return &Api{
|
||||
appKey: appKey,
|
||||
appSecret: appSecret,
|
||||
|
||||
Reference in New Issue
Block a user