Cookie验证修改

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

View File

@@ -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有效