Browse Source

修改打印日志 & eid

main
燕鹏 4 years ago
parent
commit
9be5b24322
  1. 5
      conf.ini
  2. 5
      jd_seckill/seckill.go

5
conf.ini

@ -2,8 +2,9 @@
[config] [config]
# eid, fp参数必须填写,具体请参考 wiki-常见问题 # eid, fp参数必须填写,具体请参考 wiki-常见问题
# 随意填写可能导致订单无法提交等问题 # 随意填写可能导致订单无法提交等问题
eid = URJBGAGUBX7F7NRVCGU2SUNJ224NIRTKNDYD263GEJ4OOKXA5EQY3ZU6O6Q3RFH26G6IPOQZQ6QBXDO6BR3QH2LLWI eid = DYA5PVIN34PJHFNJ2LHU35AWVE4F36ZH33UK4DV6JMWWTJE3KL6YS37CYJ3EXOLTJ3STEWIZD7AKAINCBIT4KASSFA
fp = 6daf4b091e8dc5d67632c682ac086a81 fp = 4f327de5e02bbb6c2998aaf92e078b4f
# 商品id # 商品id
# 已经是茅台的sku_id了 # 已经是茅台的sku_id了
sku_id = 100012043978 sku_id = 100012043978

5
jd_seckill/seckill.go

@ -294,7 +294,11 @@ func (this *Seckill) SubmitSeckillOrder() bool {
paymentPwd := this.conf.MustValue("account", "payment_pwd", "") paymentPwd := this.conf.MustValue("account", "payment_pwd", "")
initInfo, err := this.SeckillInitInfo() initInfo, err := this.SeckillInitInfo()
if err != nil { if err != nil {
if len(err.Error()) > 200 {
log.Println(fmt.Sprintf("抢购失败,无法获取生成订单的基本信息,接口返回: html代码"))
} else {
log.Println(fmt.Sprintf("抢购失败,无法获取生成订单的基本信息,接口返回:【%s】", err.Error())) log.Println(fmt.Sprintf("抢购失败,无法获取生成订单的基本信息,接口返回:【%s】", err.Error()))
}
return false return false
} }
address := gjson.Get(initInfo, "addressList").Array() address := gjson.Get(initInfo, "addressList").Array()
@ -355,6 +359,7 @@ func (this *Seckill) SubmitSeckillOrder() bool {
req.SetData("fp", fp) req.SetData("fp", fp)
req.SetData("token", token) req.SetData("token", token)
req.SetData("pru", "") req.SetData("pru", "")
//req.SetData("sk", "s76lo6CABKGBMSZ") // 自己添加
resp, body, err := req.SetUrl("https://marathon.jd.com/seckillnew/orderService/pc/submitOrder.action?skuId=" + skuId).SetMethod("post").Send().End() resp, body, err := req.SetUrl("https://marathon.jd.com/seckillnew/orderService/pc/submitOrder.action?skuId=" + skuId).SetMethod("post").Send().End()
if err != nil || resp.StatusCode != http.StatusOK { if err != nil || resp.StatusCode != http.StatusOK {
log.Println("抢购失败,网络错误") log.Println("抢购失败,网络错误")

Loading…
Cancel
Save