Skip to content

Commit

Permalink
fixed:调整v2.5.0测试版bug (flipped-aurora#931)
Browse files Browse the repository at this point in the history
* 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:flipped-aurora#917

Co-authored-by: helight <[email protected]>
Co-authored-by: wan9xy <[email protected]>
Co-authored-by: he <[email protected]>
Co-authored-by: 无星夜 <[email protected]>
  • Loading branch information
5 people authored Feb 24, 2022
1 parent a8caeb7 commit 1e9b44d
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 12 deletions.
8 changes: 4 additions & 4 deletions README-en.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
<img src="http://qmplusimg.henrongyi.top/gvalogo.jpg" width=300" height="300" />
</div>
<div align=center>
<img src="https://img.shields.io/badge/golang-1.14-blue"/>
<img src="https://img.shields.io/badge/golang-1.16-blue"/>
<img src="https://img.shields.io/badge/gin-1.7.0-lightBlue"/>
<img src="https://img.shields.io/badge/vue-2.6.10-brightgreen"/>
<img src="https://img.shields.io/badge/element--ui-2.12.0-green"/>
<img src="https://img.shields.io/badge/gorm-1.20.7-red"/>
<img src="https://img.shields.io/badge/vue-3.2.25-brightgreen"/>
<img src="https://img.shields.io/badge/element--plus-2.0.1-green"/>
<img src="https://img.shields.io/badge/gorm-1.22.5-red"/>
</div>

English | [简体中文](./README.md)
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
<div align=center>
<img src="https://img.shields.io/badge/golang-1.16-blue"/>
<img src="https://img.shields.io/badge/gin-1.7.0-lightBlue"/>
<img src="https://img.shields.io/badge/vue-3.0.0-brightgreen"/>
<img src="https://img.shields.io/badge/element--plus-1.1.0beta8-green"/>
<img src="https://img.shields.io/badge/gorm-1.20.7-red"/>
<img src="https://img.shields.io/badge/vue-3.2.25-brightgreen"/>
<img src="https://img.shields.io/badge/element--plus-2.0.1-green"/>
<img src="https://img.shields.io/badge/gorm-1.22.5-red"/>
</div>

[English](./README-en.md) | 简体中文
Expand Down
15 changes: 15 additions & 0 deletions server/middleware/operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion server/model/common/request/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ type PageInfo struct {

// GetById Find by id structure
type GetById struct {
ID float64 `json:"id" form:"id"` // 主键ID
ID int `json:"id" form:"id"` // 主键ID
}

func (r *GetById) Uint() uint {
Expand Down
2 changes: 1 addition & 1 deletion server/service/system/sys_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func (apiService *ApiService) GetAllApis() (err error, apis []system.SysApi) {
//@param: id float64
//@return: err error, api model.SysApi

func (apiService *ApiService) GetApiById(id float64) (err error, api system.SysApi) {
func (apiService *ApiService) GetApiById(id int) (err error, api system.SysApi) {
err = global.GVA_DB.Where("id = ?", id).First(&api).Error
return
}
Expand Down
4 changes: 2 additions & 2 deletions server/service/system/sys_base_menu.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type BaseMenuService struct{}
//@param: id float64
//@return: err error

func (baseMenuService *BaseMenuService) DeleteBaseMenu(id float64) (err error) {
func (baseMenuService *BaseMenuService) DeleteBaseMenu(id int) (err error) {
err = global.GVA_DB.Preload("MenuBtn").Preload("Parameters").Where("parent_id = ?", id).First(&system.SysBaseMenu{}).Error
if err != nil {
var menu system.SysBaseMenu
Expand Down Expand Up @@ -118,7 +118,7 @@ func (baseMenuService *BaseMenuService) UpdateBaseMenu(menu system.SysBaseMenu)
//@param: id float64
//@return: err error, menu model.SysBaseMenu

func (baseMenuService *BaseMenuService) GetBaseMenuById(id float64) (err error, menu system.SysBaseMenu) {
func (baseMenuService *BaseMenuService) GetBaseMenuById(id int) (err error, menu system.SysBaseMenu) {
err = global.GVA_DB.Preload("MenuBtn").Preload("Parameters").Where("id = ?", id).First(&menu).Error
return
}
2 changes: 1 addition & 1 deletion server/service/system/sys_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ func (userService *UserService) SetUserAuthorities(id uint, authorityIds []strin
//@param: id float64
//@return: err error

func (userService *UserService) DeleteUser(id float64) (err error) {
func (userService *UserService) DeleteUser(id int) (err error) {
var user system.SysUser
err = global.GVA_DB.Where("id = ?", id).Delete(&user).Error
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions web/src/pinia/modules/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export const useUserStore = defineStore('user', () => {
const res = await jsonInBlacklist()
if (res.code === 0) {
token.value = ''
sessionStorage.clear()
localStorage.clear()
router.push({ name: 'Login', replace: true })
window.location.reload()
Expand Down

0 comments on commit 1e9b44d

Please sign in to comment.