This commit is contained in:
邹宗楠
2023-06-30 09:48:06 +08:00
parent 61295e66ec
commit c86dc205f9
3 changed files with 36 additions and 6 deletions

View File

@@ -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: