aa
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
"git.rosy.net.cn/jx-callback/business/model/dao"
|
||||
"git.rosy.net.cn/jx-callback/business/partner"
|
||||
"git.rosy.net.cn/jx-callback/business/partner/putils"
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
@@ -37,7 +38,13 @@ func getAPI(appOrgCode string) (apiObj *jdshopapi.API) {
|
||||
if appOrgCode == "" {
|
||||
globals.SugarLogger.Warnf("getAPI appOrgCode is empty")
|
||||
}
|
||||
return partner.CurAPIManager.GetAPI(model.VendorIDJDShop, appOrgCode).(*jdshopapi.API)
|
||||
apiObj = partner.CurAPIManager.GetAPI(model.VendorIDJDShop, appOrgCode).(*jdshopapi.API)
|
||||
if appOrgCode == "2" {
|
||||
if configs, err := dao.QueryConfigs(dao.GetDB(), "jdsCookie2", model.ConfigTypeCookie, ""); err == nil {
|
||||
apiObj.SetCookieWithStr(configs[0].Value)
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (p *PurchaseHandler) GetVendorID() int {
|
||||
@@ -47,7 +54,7 @@ func (p *PurchaseHandler) GetVendorID() int {
|
||||
func (p *PurchaseHandler) UploadImg(ctx *jxcontext.Context, vendorOrgCode, imgURL string, imgData []byte, imgName string, imgType int) (imgHint string, err error) {
|
||||
if globals.EnableJdShopWrite {
|
||||
if imgType > model.ImgTypeLocal {
|
||||
result, err := api.JdShopAPI.UploadPicture(imgData, 0, imgName)
|
||||
result, err := getAPI(vendorOrgCode).UploadPicture(imgData, 0, imgName)
|
||||
if err == nil {
|
||||
imgHint = result.PictureURL
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user