用户操作权限增加角色权限过滤,优化角色/部门关系树生成,修复验证码空参数不验证问题

This commit is contained in:
孟帅
2023-08-02 17:38:40 +08:00
parent e941e52d3e
commit 3df5236623
28 changed files with 1097 additions and 887 deletions

View File

@@ -3,7 +3,6 @@
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
//
package consts
// 数据范围
@@ -30,3 +29,62 @@ var RoleDataNameMap = map[int]string{
RoleDataSelfAndSub: "自己和直属下级",
RoleDataSelfAndAllSub: "自己和全部下级",
}
type GroupScopeSelect struct {
Type string `json:"type,omitempty"`
Label string `json:"label"`
Key int `json:"key"`
Value int `json:"value,omitempty"`
Children []ScopeSelect `json:"children,omitempty"`
}
type ScopeSelect struct {
Label string `json:"label"`
Value int `json:"value"`
}
var DataScopeSelect = []GroupScopeSelect{
{
Label: RoleDataNameMap[RoleDataAll],
Key: RoleDataAll,
Value: RoleDataAll,
},
{
Type: "group",
Label: "按部门划分",
Key: -1,
Children: []ScopeSelect{
{
Label: RoleDataNameMap[RoleDataNowDept],
Value: RoleDataNowDept,
},
{
Label: RoleDataNameMap[RoleDataDeptAndSub],
Value: RoleDataDeptAndSub,
},
{
Label: RoleDataNameMap[RoleDataDeptCustom],
Value: RoleDataDeptCustom,
},
},
},
{
Type: "group",
Label: "按上下级关系划分",
Key: -2,
Children: []ScopeSelect{
{
Label: RoleDataNameMap[RoleDataSelf],
Value: RoleDataSelf,
},
{
Label: RoleDataNameMap[RoleDataSelfAndSub],
Value: RoleDataSelfAndSub,
},
{
Label: RoleDataNameMap[RoleDataSelfAndAllSub],
Value: RoleDataSelfAndAllSub,
},
},
},
}