From 64c59506dded8e19cb1360e057e59f9888cda0a7 Mon Sep 17 00:00:00 2001 From: cdle <798731886@qq.com> Date: Sun, 17 Oct 2021 06:10:07 +0800 Subject: [PATCH] update --- core/reply.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/core/reply.go b/core/reply.go index 1914614..2a37e84 100644 --- a/core/reply.go +++ b/core/reply.go @@ -5,8 +5,8 @@ import ( "io/ioutil" "net/url" "regexp" - "strings" "strconv" + "strings" "time" "github.com/beego/beego/v2/adapter/httplib" @@ -53,13 +53,7 @@ func InitReplies() { if reply.Request.Disappear { s.Disappear() } - timeUnix := strconv.FormatInt(time.Now().Unix(), 10) Url := reply.Request.Url - if strings.Contains(Url, "?") { - Url = Url + "&_=" + timeUnix - } else { - Url = Url + "?_=" + timeUnix - } body := reply.Request.Body for k, v := range s.GetMatch() { Url = strings.Replace(Url, fmt.Sprintf(`{{%d}}`, k+1), v, -1) @@ -122,6 +116,12 @@ func InitReplies() { } return nil } + timeUnix := strconv.FormatInt(time.Now().Unix(), 10) + if strings.Contains(Url, "?") { + Url = Url + "&_=" + timeUnix + } else { + Url = Url + "?_=" + timeUnix + } s.Reply(ImageUrl(Url)) case "json": d := data()