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()