From 8921101ebc5231d236b14dbabdbabb1ece2cc0c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Thu, 16 Jan 2020 16:04:13 +0800 Subject: [PATCH] =?UTF-8?q?Cookie=E9=AA=8C=E8=AF=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/event/event.go | 34 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/business/jxstore/event/event.go b/business/jxstore/event/event.go index c8b4a4d52..454b9e079 100644 --- a/business/jxstore/event/event.go +++ b/business/jxstore/event/event.go @@ -130,13 +130,11 @@ func GetCheckVendorCookie(ctx *jxcontext.Context, vendorIDs []int, isAuto bool) case 3: resultMap, err := api.EbaiAPI.GetStoreOrderInfo(ebaiOrderID) if len(resultMap) < 1 && err != nil { - if errExt, ok := err.(*utils.ErrorWithCode); ok { - if strings.Contains(errExt.ErrMsg(), ebaiErr) { - //Cookie无效了 - errMsg += " 饿百Cookie无效了!" - cc.VendorID = v - cc.Status = "无效" - } + if strings.Contains(err.Error(), ebaiErr) { + //Cookie无效了 + errMsg += " 饿百Cookie无效了!" + cc.VendorID = v + cc.Status = "无效" } } else { //Cookie有效 @@ -146,12 +144,10 @@ func GetCheckVendorCookie(ctx *jxcontext.Context, vendorIDs []int, isAuto bool) case 1: err := api.MtwmAPI.OrderModityTips(mtOrderID, mtStoreID, 0.2) if err != nil { - if errExt, ok := err.(*utils.ErrorWithCode); ok { - if strings.Contains(errExt.ErrMsg(), mtErr) { - errMsg += " 美团Cookie无效了!" - cc.VendorID = v - cc.Status = "无效" - } + if strings.Contains(err.Error(), mtErr) { + errMsg += " 美团Cookie无效了!" + cc.VendorID = v + cc.Status = "无效" } } else { //Cookie有效 @@ -162,13 +158,11 @@ func GetCheckVendorCookie(ctx *jxcontext.Context, vendorIDs []int, isAuto bool) for _, vv := range apimanager.CurAPIManager.GetAppOrgCodeList(v) { result, err := jd.GetAPI(vv).GetJdUpcCodeByName("", jdUpcCode, 1, 5) if len(result) < 1 && err != nil { - if errExt, ok := err.(*utils.ErrorWithCode); ok { - if strings.Contains(errExt.ErrMsg(), jdErr) { - //Cookie无效 - errMsg += " 京东Cookie无效了!" - cc.VendorID = v - cc.Status = "无效" - } + if strings.Contains(err.Error(), jdErr) { + //Cookie无效 + errMsg += " 京东Cookie无效了!" + cc.VendorID = v + cc.Status = "无效" } } else { //Cookie有效