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