1
This commit is contained in:
@@ -2,6 +2,7 @@ package apimanager
|
||||
|
||||
import (
|
||||
"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"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
||||
@@ -63,7 +64,20 @@ func (a *APIManager) GetAPI(vendorID int, appOrgCode string) (pfAPI interface{})
|
||||
pfAPI = api.Mtwm2API
|
||||
}
|
||||
case model.VendorIDTaoVegetable:
|
||||
pfAPI = api.TaoVegetableApi
|
||||
api := api.TaoVegetableApi
|
||||
if beego.BConfig.RunMode == "dev" {
|
||||
api.SetToken("50002C00414zMSClqLiSDjBr2N19748391yiazjtFmsgTOdbBftik0XDfkUQywSmcjfC")
|
||||
} else if api == nil || api.GetToken() == "" {
|
||||
codes, _ := dao.GetVendorOrgCode(db, vendorID, appOrgCode, "platform")
|
||||
if len(codes) == 0 {
|
||||
return nil
|
||||
}
|
||||
code := codes[0]
|
||||
api = tao_vegetable.NewTaoVegetable(code.AppKey, code.AppSecret, beego.AppConfig.DefaultString("taoVegetableServerUrl", ""))
|
||||
api.SetToken(code.Token)
|
||||
}
|
||||
|
||||
pfAPI = api
|
||||
case model.VendorIDEBAI:
|
||||
pfAPI = api.EbaiAPI
|
||||
case model.VendorIDJDShop:
|
||||
|
||||
Reference in New Issue
Block a user