This commit is contained in:
suyl
2021-06-22 10:38:59 +08:00
parent 4e90f3e6d8
commit c634c56114
2 changed files with 12 additions and 1 deletions

View File

@@ -47,6 +47,17 @@ func getAPI(appOrgCode string) (apiObj *jdshopapi.API) {
return apiObj
}
func getAPI2(appOrgCode string) (apiObj *jdshopapi.API) {
if appOrgCode == "" {
globals.SugarLogger.Warnf("getAPI appOrgCode is empty")
}
apiObj = partner.CurAPIManager.GetAPI(model.VendorIDJDShop, appOrgCode).(*jdshopapi.API)
if configs, err := dao.QueryConfigs(dao.GetDB(), "jdsCookie", model.ConfigTypeCookie, ""); err == nil {
apiObj.SetCookieWithStr(configs[0].Value)
}
return apiObj
}
func GetAPI(appOrgCode string) (apiObj *jdshopapi.API) {
apiObj = partner.CurAPIManager.GetAPI(model.VendorIDJDShop, appOrgCode).(*jdshopapi.API)
if configs, err := dao.QueryConfigs(dao.GetDB(), "jdsCookie2", model.ConfigTypeCookie, ""); err == nil {

View File

@@ -786,7 +786,7 @@ func updateOrCreateCategories(storeCat *dao.SkuStoreCatInfo, isCreate bool) (sta
}
}
}
status, err = getAPI(storeCat.VendorOrgCode).CreateShopCategory(createShopCategoryParams)
status, err = getAPI2(storeCat.VendorOrgCode).CreateShopCategory(createShopCategoryParams)
return status, err
}