新增按钮权限,增加redis可独立配置 (#923)

* fix jwt to golang-jwt, gin to 1.7.0

* 增加按钮权限功能

* 增加redis可独立配置

Co-authored-by: helight <helight@helight.info>
This commit is contained in:
奇淼(piexlmax
2022-02-22 00:26:21 +08:00
committed by GitHub
co-authored by helight
parent f389ff701a
commit 6a97f39f66
33 changed files with 5024 additions and 542 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
package request
import (
"github.com/dgrijalva/jwt-go"
"github.com/golang-jwt/jwt/v4"
uuid "github.com/satori/go.uuid"
)
@@ -0,0 +1,7 @@
package request
type SysAuthorityBtnReq struct {
MenuID uint `json:"menuID"`
AuthorityId string `json:"authorityId"`
Selected []uint `json:"selected"`
}
@@ -0,0 +1,5 @@
package response
type SysAuthorityBtnRes struct {
Selected []uint `json:"selected"`
}
+8
View File
@@ -0,0 +1,8 @@
package system
type SysAuthorityBtn struct {
AuthorityId string
SysMenuID uint
SysBaseMenuBtnID uint
SysBaseMenuBtn SysBaseMenuBtn
}
@@ -6,6 +6,7 @@ type SysMenu struct {
AuthorityId string `json:"-" gorm:"comment:角色ID"`
Children []SysMenu `json:"children" gorm:"-"`
Parameters []SysBaseMenuParameter `json:"parameters" gorm:"foreignKey:SysBaseMenuID;references:MenuId"`
Btns map[string]string `json:"btns" gorm:"-"`
}
func (s SysMenu) TableName() string {
+1
View File
@@ -17,6 +17,7 @@ type SysBaseMenu struct {
SysAuthoritys []SysAuthority `json:"authoritys" gorm:"many2many:sys_authority_menus;"`
Children []SysBaseMenu `json:"children" gorm:"-"`
Parameters []SysBaseMenuParameter `json:"parameters"`
MenuBtn []SysBaseMenuBtn `json:"menuBtn"`
}
type Meta struct {
+10
View File
@@ -0,0 +1,10 @@
package system
import "github.com/flipped-aurora/gin-vue-admin/server/global"
type SysBaseMenuBtn struct {
global.GVA_MODEL
Name string `json:"name" gorm:"comment:按钮关键key"`
Desc string `json:"desc" gorm:"按钮备注"`
SysBaseMenuID uint `json:"sysBaseMenuID" gorm:"comment:菜单ID"`
}