Skip to content

Commit

Permalink
Update main.go
Browse files Browse the repository at this point in the history
  • Loading branch information
ygxbnet committed Feb 9, 2025
1 parent c242471 commit 09ac425
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ func main() {
refreshTokensRegularly() // 定时刷新 token

// 定时任务,每天 3:00 定时执行一次
c := cron.NewWithLocation(time.FixedZone("CST", 8*3600))
c := cron.New()
fmt.Println("【定时任务】已开启定时任务,每天 3:00 定时签到")
c.AddFunc("0 3 * * *", func() {
signInInfo, err := ttapi.SignIn(token)
if err != nil || signInInfo != "{}" {
if err != nil || gjson.Get(signInInfo, "errCode").Int() != 0 {
fmt.Println("【定时签到】签到失败:", signInInfo, err)
} else {
fmt.Println(time.Now().Format("2006-01-02 15:04:05"), " 【定时签到】签到成功!")
Expand Down

0 comments on commit 09ac425

Please sign in to comment.