fixed:调整v2.5.0测试版bug (#931)

* update readme badge for en

* server/middleware/operation.go : fix 当记录日志当请求为GET时,不对query参数进行记录

* update element badge to element--plus-2.0.1-green

* fix unmatched type of id field

* update badge for vue gorm in readme

* fixed:#917

Co-authored-by: helight <helight@helight.info>
Co-authored-by: wan9xy <wan9xy@qq.com>
Co-authored-by: he <trumanhe0@gmail.com>
Co-authored-by: 无星夜 <31583810+TrumanH@users.noreply.github.com>
This commit is contained in:
奇淼(piexlmax
2022-02-24 11:49:37 +08:00
committed by GitHub
parent c8ce379163
commit 30b16984ed
8 changed files with 28 additions and 12 deletions

View File

@@ -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 {