修复微信请求图片不能更新问题

This commit is contained in:
xumf
2021-10-15 22:26:46 +08:00
parent 42cf1a67c0
commit 77a7237858
+7
View File
@@ -6,6 +6,7 @@ import (
"net/url"
"regexp"
"strings"
"strconv"
"time"
"github.com/beego/beego/v2/adapter/httplib"
@@ -52,7 +53,13 @@ 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)