From a99588e6eaee934f8da5d5000a411eaeb5cd34e5 Mon Sep 17 00:00:00 2001 From: ztino <> Date: Wed, 6 Jan 2021 19:09:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E4=BA=9B=E7=BB=86=E8=8A=82=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/var.go | 2 +- go.mod | 1 - jd_seckill/seckill.go | 5 +---- jd_seckill/user.go | 5 ++--- service/email.go | 2 +- 5 files changed, 5 insertions(+), 10 deletions(-) diff --git a/common/var.go b/common/var.go index 42b57c5..468685c 100644 --- a/common/var.go +++ b/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" ) diff --git a/go.mod b/go.mod index c2bf98c..266f514 100644 --- a/go.mod +++ b/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 diff --git a/jd_seckill/seckill.go b/jd_seckill/seckill.go index 968e12d..8b8fb30 100644 --- a/jd_seckill/seckill.go +++ b/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) diff --git a/jd_seckill/user.go b/jd_seckill/user.go index ad65a88..bc84d79 100644 --- a/jd_seckill/user.go +++ b/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) } } diff --git a/service/email.go b/service/email.go index 29b60e5..cd6b351 100644 --- a/service/email.go +++ b/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" )