Cookie验证修改

This commit is contained in:
苏尹岚
2020-01-16 16:04:13 +08:00
parent 424aa42745
commit 8921101ebc

View File

@@ -130,14 +130,12 @@ 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) {
if strings.Contains(err.Error(), ebaiErr) {
//Cookie无效了
errMsg += " 饿百Cookie无效了"
cc.VendorID = v
cc.Status = "无效"
}
}
} else {
//Cookie有效
cc.VendorID = v
@@ -146,13 +144,11 @@ 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) {
if strings.Contains(err.Error(), mtErr) {
errMsg += " 美团Cookie无效了"
cc.VendorID = v
cc.Status = "无效"
}
}
} else {
//Cookie有效
cc.VendorID = v
@@ -162,14 +158,12 @@ 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) {
if strings.Contains(err.Error(), jdErr) {
//Cookie无效
errMsg += " 京东Cookie无效了"
cc.VendorID = v
cc.Status = "无效"
}
}
} else {
//Cookie有效
cc.VendorID = v