Cookie验证美团修改

This commit is contained in:
苏尹岚
2020-01-16 16:00:09 +08:00
parent ff1a3f456c
commit 424aa42745

View File

@@ -119,6 +119,7 @@ func GetCheckVendorCookie(ctx *jxcontext.Context, vendorIDs []int, isAuto bool)
ebaiErr = "return not json"
mtOrderID = "69761763472881638"
mtStoreID = "6976176"
mtErr = "返回结果格式不正常"
jdUpcCode = "6952395700895"
jdErr = "请输入用户名"
errMsg = ""
@@ -143,13 +144,16 @@ func GetCheckVendorCookie(ctx *jxcontext.Context, vendorIDs []int, isAuto bool)
cc.Status = "有效"
}
case 1:
result, err := api.MtwmAPI.GetDistributeOrderDetail(mtOrderID, mtStoreID)
if result == nil && err == nil {
//Cookie无效
errMsg += " 美团Cookie无效了"
cc.VendorID = v
cc.Status = "无效"
} else if result != nil {
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 = "无效"
}
}
} else {
//Cookie有效
cc.VendorID = v
cc.Status = "有效"