This commit is contained in:
邹宗楠
2023-06-30 11:56:36 +08:00
parent 0e93970cd8
commit d0b8bb3e9e
4 changed files with 39 additions and 22 deletions

View File

@@ -1,6 +1,7 @@
package apimanager
import (
"encoding/json"
"git.rosy.net.cn/baseapi/platformapi/jdapi"
"git.rosy.net.cn/baseapi/platformapi/tao_vegetable"
"git.rosy.net.cn/baseapi/platformapi/tiktok_shop/tiktok_api"
@@ -74,7 +75,13 @@ func (a *APIManager) GetAPI(vendorID int, appOrgCode string) (pfAPI interface{})
}
code := codes[0]
api = tao_vegetable.NewTaoVegetable(code.AppKey, code.AppSecret, beego.AppConfig.DefaultString("taoVegetableServerUrl", ""))
api.SetToken(code.Token)
if code.Token != "" {
var tokenInfo *tao_vegetable.StoreTokenInfo
json.Unmarshal([]byte(code.Token), &tokenInfo)
if tokenInfo.AccessToken != "" {
api.SetToken(tokenInfo.AccessToken)
}
}
}
pfAPI = api