From 485610bb39c2327136302182a08aada4131c451b Mon Sep 17 00:00:00 2001 From: wan9xy Date: Tue, 22 Feb 2022 16:11:43 +0800 Subject: [PATCH] =?UTF-8?q?server/middleware/operation.go=20:=20fix=20?= =?UTF-8?q?=E5=BD=93=E9=9C=80=E8=A6=81=E8=AE=B0=E5=BD=95=E5=BD=93=E8=AF=B7?= =?UTF-8?q?=E6=B1=82=E4=B8=BAget=E6=97=B6=EF=BC=8C=E4=B8=8D=E5=AF=B9query?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E8=BF=9B=E8=A1=8C=E8=AE=B0=E5=BD=95=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/middleware/operation.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/server/middleware/operation.go b/server/middleware/operation.go index ea207de8..dba9a2a7 100644 --- a/server/middleware/operation.go +++ b/server/middleware/operation.go @@ -2,9 +2,12 @@ package middleware import ( "bytes" + "encoding/json" "io/ioutil" "net/http" + "net/url" "strconv" + "strings" "time" "github.com/flipped-aurora/gin-vue-admin/server/utils" @@ -30,6 +33,18 @@ func OperationRecord() gin.HandlerFunc { } else { c.Request.Body = ioutil.NopCloser(bytes.NewBuffer(body)) } + } else { + query := c.Request.URL.RawQuery + query, _ = url.QueryUnescape(query) + split := strings.Split(query, "&") + m := make(map[string]string) + for _, v := range split { + kv := strings.Split(v, "=") + if len(kv) == 2 { + m[kv[0]] = kv[1] + } + } + body, _ = json.Marshal(&m) } claims, _ := utils.GetClaims(c) if claims.ID != 0 { -- Gitee