Merge pull request #18 from xumf/main

解决微信图片缓存bug
This commit is contained in:
cdle
2021-10-15 23:01:28 +08:00
committed by GitHub
+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)