Przeglądaj źródła

一些细节修改

main
ztino 4 lat temu
rodzic
commit
a99588e6ea
  1. 2
      common/var.go
  2. 1
      go.mod
  3. 5
      jd_seckill/seckill.go
  4. 5
      jd_seckill/user.go
  5. 2
      service/email.go

2
common/var.go

@ -7,7 +7,7 @@ import (
const (
SoftName = "jd_seckill"
Version = "0.2.0"
Version = "0.2.1"
DateTimeFormatStr = "2006-01-02 15:04:05"
DateFormatStr = "2006-01-02"
)

1
go.mod

@ -4,7 +4,6 @@ go 1.15
require (
github.com/Albert-Zhan/httpc v0.0.0-20190712132051-aed72924b5e6
github.com/CodyGuo/win v0.0.0-20170113125346-08e6b7208274
github.com/PuerkitoBio/goquery v1.6.0
github.com/blinkbean/dingtalk v0.0.0-20201231030509-45a553a84503
github.com/chromedp/cdproto v0.0.0-20201204063249-be40c824ad18

5
jd_seckill/seckill.go

@ -8,8 +8,8 @@ import (
"github.com/tidwall/gjson"
"github.com/unknwon/goconfig"
"github.com/ztino/jd_seckill/common"
"github.com/ztino/jd_seckill/service"
"github.com/ztino/jd_seckill/log"
"github.com/ztino/jd_seckill/service"
"net/http"
"strconv"
"strings"
@ -241,9 +241,6 @@ func (this *Seckill) SubmitSeckillOrder() bool {
return false
}
//临时打印数据
log.Println("返回信息:"+body)
if !gjson.Valid(body) {
log.Println("抢购失败,返回信息:" + body)
_ = service.SendMessage(this.conf, "茅台抢购通知", "抢购失败,返回信息:"+body)

5
jd_seckill/user.go

@ -141,8 +141,7 @@ func (this *User) GetUserInfo() (string,error) {
func (this *User) DelQrCode() {
dir, _ := os.Getwd()
qrPath := filepath.Join(dir, `./qr_code.png`)
log.Println(qrPath)
if _, err := os.Stat(qrPath); !os.IsNotExist(err) {
os.Remove(qrPath)
if common.Exists(qrPath) {
_=os.Remove(qrPath)
}
}

2
service/email.go

@ -2,8 +2,8 @@ package service
import (
"github.com/unknwon/goconfig"
"gopkg.in/gomail.v2"
"github.com/ztino/jd_seckill/log"
"gopkg.in/gomail.v2"
"strconv"
)

Ładowanie…
Anuluj
Zapisz