Browse Source

一些细节修改

main
ztino 4 years ago
parent
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 ( const (
SoftName = "jd_seckill" SoftName = "jd_seckill"
Version = "0.2.0" Version = "0.2.1"
DateTimeFormatStr = "2006-01-02 15:04:05" DateTimeFormatStr = "2006-01-02 15:04:05"
DateFormatStr = "2006-01-02" DateFormatStr = "2006-01-02"
) )

1
go.mod

@ -4,7 +4,6 @@ go 1.15
require ( require (
github.com/Albert-Zhan/httpc v0.0.0-20190712132051-aed72924b5e6 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/PuerkitoBio/goquery v1.6.0
github.com/blinkbean/dingtalk v0.0.0-20201231030509-45a553a84503 github.com/blinkbean/dingtalk v0.0.0-20201231030509-45a553a84503
github.com/chromedp/cdproto v0.0.0-20201204063249-be40c824ad18 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/tidwall/gjson"
"github.com/unknwon/goconfig" "github.com/unknwon/goconfig"
"github.com/ztino/jd_seckill/common" "github.com/ztino/jd_seckill/common"
"github.com/ztino/jd_seckill/service"
"github.com/ztino/jd_seckill/log" "github.com/ztino/jd_seckill/log"
"github.com/ztino/jd_seckill/service"
"net/http" "net/http"
"strconv" "strconv"
"strings" "strings"
@ -241,9 +241,6 @@ func (this *Seckill) SubmitSeckillOrder() bool {
return false return false
} }
//临时打印数据
log.Println("返回信息:"+body)
if !gjson.Valid(body) { if !gjson.Valid(body) {
log.Println("抢购失败,返回信息:" + body) log.Println("抢购失败,返回信息:" + body)
_ = service.SendMessage(this.conf, "茅台抢购通知", "抢购失败,返回信息:"+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() { func (this *User) DelQrCode() {
dir, _ := os.Getwd() dir, _ := os.Getwd()
qrPath := filepath.Join(dir, `./qr_code.png`) qrPath := filepath.Join(dir, `./qr_code.png`)
log.Println(qrPath) if common.Exists(qrPath) {
if _, err := os.Stat(qrPath); !os.IsNotExist(err) { _=os.Remove(qrPath)
os.Remove(qrPath)
} }
} }

2
service/email.go

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

Loading…
Cancel
Save