From d8662a6da4b10df4c4347ce9606224395bdda58c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Fri, 15 May 2020 16:13:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E9=97=A8=E5=BA=97=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- platformapi/jdshopapi/store.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/platformapi/jdshopapi/store.go b/platformapi/jdshopapi/store.go index 3232bc58..3f05bdc1 100644 --- a/platformapi/jdshopapi/store.go +++ b/platformapi/jdshopapi/store.go @@ -1,6 +1,8 @@ package jdshopapi import ( + "fmt" + "git.rosy.net.cn/baseapi/utils" ) @@ -36,6 +38,9 @@ type GetAddressCodeResult struct { func (a *API) CreateEntityStore(createEntityStoreParam *CreateEntityStoreParam) (vendorStoreID string, err error) { result, err := a.AccessAPI("jingdong.createEntityStore", prodURL, utils.Struct2FlatMap(createEntityStoreParam)) if err == nil { + if !result["jingdong_createEntityStore_responce"].(map[string]interface{})["createentitystore_result"].(map[string]interface{})["success"].(bool) { + return vendorStoreID, fmt.Errorf(result["jingdong_createEntityStore_responce"].(map[string]interface{})["createentitystore_result"].(map[string]interface{})["message"].(string)) + } return result["jingdong_createEntityStore_responce"].(map[string]interface{})["createentitystore_result"].(map[string]interface{})["result"].(map[string]interface{})["name"].(string), err } return vendorStoreID, err