feat:优化信息
This commit is contained in:
@ -3,7 +3,6 @@ package common
|
|||||||
import (
|
import (
|
||||||
"ArmedPolice/app/common/model"
|
"ArmedPolice/app/common/model"
|
||||||
"ArmedPolice/config"
|
"ArmedPolice/config"
|
||||||
"ArmedPolice/lib"
|
|
||||||
"ArmedPolice/serve/orm"
|
"ArmedPolice/serve/orm"
|
||||||
"ArmedPolice/utils"
|
"ArmedPolice/utils"
|
||||||
)
|
)
|
||||||
@ -96,7 +95,7 @@ func initModel() {
|
|||||||
|
|
||||||
out := make([]*model.SysConfig, 0)
|
out := make([]*model.SysConfig, 0)
|
||||||
|
|
||||||
lib.LoadConfig("./json/sys_config.json", &values, func(i interface{}) {
|
utils.LoadConfig("./json/sys_config.json", &values, func(i interface{}) {
|
||||||
for _, v := range values {
|
for _, v := range values {
|
||||||
out = append(out, &model.SysConfig{
|
out = append(out, &model.SysConfig{
|
||||||
Model: model.Model{ID: v.ID},
|
Model: model.Model{ID: v.ID},
|
||||||
@ -115,7 +114,7 @@ func initModel() {
|
|||||||
|
|
||||||
out := make([]*model.SysMenu, 0)
|
out := make([]*model.SysMenu, 0)
|
||||||
|
|
||||||
lib.LoadConfig("./json/sys_menu.json", &values, func(i interface{}) {
|
utils.LoadConfig("./json/sys_menu.json", &values, func(i interface{}) {
|
||||||
for _, v := range values {
|
for _, v := range values {
|
||||||
out = append(out, &model.SysMenu{
|
out = append(out, &model.SysMenu{
|
||||||
Model: model.Model{ID: v.ID},
|
Model: model.Model{ID: v.ID},
|
||||||
@ -145,7 +144,7 @@ func initModel() {
|
|||||||
out := make([]*model.SysRole, 0)
|
out := make([]*model.SysRole, 0)
|
||||||
values := make([]*structForSysRole, 0)
|
values := make([]*structForSysRole, 0)
|
||||||
|
|
||||||
lib.LoadConfig("./json/sys_role.json", &values, func(i interface{}) {
|
utils.LoadConfig("./json/sys_role.json", &values, func(i interface{}) {
|
||||||
for _, v := range values {
|
for _, v := range values {
|
||||||
out = append(out, &model.SysRole{
|
out = append(out, &model.SysRole{
|
||||||
Model: model.Model{ID: v.ID},
|
Model: model.Model{ID: v.ID},
|
||||||
@ -177,7 +176,7 @@ func initModel() {
|
|||||||
|
|
||||||
values := make([]*structForWorkSchedule, 0)
|
values := make([]*structForWorkSchedule, 0)
|
||||||
|
|
||||||
lib.LoadConfig("./json/work_schedule.json", &values, func(i interface{}) {
|
utils.LoadConfig("./json/work_schedule.json", &values, func(i interface{}) {
|
||||||
for _, v := range values {
|
for _, v := range values {
|
||||||
out = append(out, &model.WorkSchedule{
|
out = append(out, &model.WorkSchedule{
|
||||||
Model: model.Model{ID: v.ID},
|
Model: model.Model{ID: v.ID},
|
||||||
|
@ -1,19 +1,29 @@
|
|||||||
package user
|
package user
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"ArmedPolice/app/controller/menu"
|
model2 "ArmedPolice/app/common/model"
|
||||||
|
"ArmedPolice/app/controller/basic"
|
||||||
"ArmedPolice/app/model"
|
"ArmedPolice/app/model"
|
||||||
"ArmedPolice/app/service"
|
"ArmedPolice/app/service"
|
||||||
"ArmedPolice/utils"
|
|
||||||
"fmt"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type Menu struct{ *service.Session }
|
type Menu struct{ *service.Session }
|
||||||
|
|
||||||
type MenuHandle func(session *service.Session) *Menu
|
type MenuHandle func(session *service.Session) *Menu
|
||||||
|
|
||||||
|
type MenuInfo struct {
|
||||||
|
basic.CommonIDString
|
||||||
|
*model2.SysMenuBasic
|
||||||
|
ParentID string `json:"parent_id"`
|
||||||
|
// 与前端约定
|
||||||
|
Meta struct {
|
||||||
|
Title string `json:"title"`
|
||||||
|
} `json:"meta"`
|
||||||
|
Path string `json:"path"`
|
||||||
|
}
|
||||||
|
|
||||||
// Menu 用户菜单信息
|
// Menu 用户菜单信息
|
||||||
func (c *Menu) Menu() ([]*menu.InstanceIdentityInfo, error) {
|
func (c *Menu) Menu() ([]*MenuInfo, error) {
|
||||||
mSysMenu := model.NewSysMenu()
|
mSysMenu := model.NewSysMenu()
|
||||||
|
|
||||||
out := make([]*model.SysMenuScene, 0)
|
out := make([]*model.SysMenuScene, 0)
|
||||||
@ -28,9 +38,25 @@ func (c *Menu) Menu() ([]*menu.InstanceIdentityInfo, error) {
|
|||||||
if out, err = mSysMenu.UserMenu(c.UID); err != nil {
|
if out, err = mSysMenu.UserMenu(c.UID); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
fmt.Println(utils.AnyToJSON(out))
|
|
||||||
RETURN:
|
RETURN:
|
||||||
return menu.TreeIdentity(mSysMenu.SysMenu, out, 0), nil
|
list := make([]*MenuInfo, 0)
|
||||||
|
|
||||||
|
for _, v := range out {
|
||||||
|
mSysMenu.SetID(v.ID)
|
||||||
|
data := &MenuInfo{
|
||||||
|
CommonIDString: basic.CommonIDString{ID: mSysMenu.GetEncodeID()},
|
||||||
|
SysMenuBasic: v.SysMenuBasic,
|
||||||
|
ParentID: (&model2.Model{ID: v.ParentID}).GetEncodeID(),
|
||||||
|
Meta: struct {
|
||||||
|
Title string `json:"title"`
|
||||||
|
}{Title: v.Name},
|
||||||
|
}
|
||||||
|
data.Name = v.Link
|
||||||
|
data.Path = v.Link
|
||||||
|
list = append(list, data)
|
||||||
|
}
|
||||||
|
return list, nil
|
||||||
|
//return menu.TreeIdentity(mSysMenu.SysMenu, out, 0), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewMenu() MenuHandle {
|
func NewMenu() MenuHandle {
|
||||||
|
@ -4,7 +4,6 @@ import (
|
|||||||
"ArmedPolice/app/event"
|
"ArmedPolice/app/event"
|
||||||
"ArmedPolice/app/service"
|
"ArmedPolice/app/service"
|
||||||
"ArmedPolice/config"
|
"ArmedPolice/config"
|
||||||
"ArmedPolice/lib"
|
|
||||||
"ArmedPolice/utils"
|
"ArmedPolice/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -14,7 +13,7 @@ func Init() {
|
|||||||
service.NewHub().Run()
|
service.NewHub().Run()
|
||||||
})
|
})
|
||||||
// 载入数据配置
|
// 载入数据配置
|
||||||
lib.LoadConfig("./json/area.json", &config.SettingAreaInfo)
|
utils.LoadConfig("./json/area.json", &config.SettingAreaInfo)
|
||||||
// RedisHash存储/移除监听
|
// RedisHash存储/移除监听
|
||||||
service.Subscribe(config.EventForRedisHashProduce, event.NewRedisHashProduce())
|
service.Subscribe(config.EventForRedisHashProduce, event.NewRedisHashProduce())
|
||||||
service.Subscribe(config.EventForRedisHashDestroy, event.NewRedisHashDestroy())
|
service.Subscribe(config.EventForRedisHashDestroy, event.NewRedisHashDestroy())
|
||||||
|
@ -20,7 +20,7 @@ func (this *Session) MarshalBinary() ([]byte, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (this *Session) UnmarshalBinary(data []byte) error {
|
func (this *Session) UnmarshalBinary(data []byte) error {
|
||||||
return utils.FromJSONBytes(data, this)
|
return json.Unmarshal(data, this)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *Session) UIDToString() string {
|
func (this *Session) UIDToString() string {
|
||||||
|
@ -4,13 +4,13 @@ import (
|
|||||||
"ArmedPolice/app"
|
"ArmedPolice/app"
|
||||||
"ArmedPolice/app/common"
|
"ArmedPolice/app/common"
|
||||||
"ArmedPolice/config"
|
"ArmedPolice/config"
|
||||||
"ArmedPolice/lib"
|
|
||||||
"ArmedPolice/router"
|
"ArmedPolice/router"
|
||||||
"ArmedPolice/serve/cache"
|
"ArmedPolice/serve/cache"
|
||||||
"ArmedPolice/serve/logger"
|
"ArmedPolice/serve/logger"
|
||||||
"ArmedPolice/serve/orm"
|
"ArmedPolice/serve/orm"
|
||||||
"ArmedPolice/serve/web"
|
"ArmedPolice/serve/web"
|
||||||
"ArmedPolice/task"
|
"ArmedPolice/task"
|
||||||
|
"ArmedPolice/utils"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
@ -25,7 +25,7 @@ type Option struct {
|
|||||||
|
|
||||||
func (this *Serve) Run() {
|
func (this *Serve) Run() {
|
||||||
// 载入配置
|
// 载入配置
|
||||||
lib.LoadConfig(this.Option.Config, config.SettingInfo, func(i interface{}) {
|
utils.LoadConfig(this.Option.Config, config.SettingInfo, func(i interface{}) {
|
||||||
obj := i.(*config.Setting)
|
obj := i.(*config.Setting)
|
||||||
obj.Upload.Exts = strings.Split(obj.Upload.Ext, ",")
|
obj.Upload.Exts = strings.Split(obj.Upload.Ext, ",")
|
||||||
logger.NewLogger().Init(&logger.Option{File: obj.Log.File, LeastDay: obj.Log.LeastDay, Level: obj.Log.Level, IsStdout: false}).Load()
|
logger.NewLogger().Init(&logger.Option{File: obj.Log.File, LeastDay: obj.Log.LeastDay, Level: obj.Log.Level, IsStdout: false}).Load()
|
||||||
|
@ -1,296 +1,410 @@
|
|||||||
[
|
{
|
||||||
{
|
"RECORDS": [
|
||||||
"id": 10,
|
{
|
||||||
"parent_id": 0,
|
"id": 10,
|
||||||
"name": "装备维修",
|
"parent_id": 0,
|
||||||
"kind": 1,
|
"name": "装备维修",
|
||||||
"link": null,
|
"kind": 1,
|
||||||
"component": null,
|
"link": null,
|
||||||
"icon": null,
|
"component": "Layout",
|
||||||
"auth": 0,
|
"icon": null,
|
||||||
"sort": 10,
|
"auth": 0,
|
||||||
"remark": null,
|
"sort": 10,
|
||||||
"status": 1,
|
"remark": null,
|
||||||
"is_deleted": 0
|
"status": 1,
|
||||||
},
|
"is_deleted": 0
|
||||||
{
|
},
|
||||||
"id": 11,
|
{
|
||||||
"parent_id": 0,
|
"id": 11,
|
||||||
"name": "装备型谱目录",
|
"parent_id": 0,
|
||||||
"kind": 1,
|
"name": "装备型谱目录",
|
||||||
"link": null,
|
"kind": 1,
|
||||||
"component": null,
|
"link": null,
|
||||||
"icon": null,
|
"component": "Layout",
|
||||||
"auth": 0,
|
"icon": null,
|
||||||
"sort": 9,
|
"auth": 0,
|
||||||
"remark": null,
|
"sort": 9,
|
||||||
"status": 1,
|
"remark": null,
|
||||||
"is_deleted": 0
|
"status": 1,
|
||||||
},
|
"is_deleted": 0
|
||||||
{
|
},
|
||||||
"id": 12,
|
{
|
||||||
"parent_id": 0,
|
"id": 12,
|
||||||
"name": "器材库",
|
"parent_id": 0,
|
||||||
"kind": 1,
|
"name": "器材库",
|
||||||
"link": null,
|
"kind": 1,
|
||||||
"component": null,
|
"link": null,
|
||||||
"icon": null,
|
"component": "Layout",
|
||||||
"auth": 0,
|
"icon": null,
|
||||||
"sort": 8,
|
"auth": 0,
|
||||||
"remark": null,
|
"sort": 8,
|
||||||
"status": 1,
|
"remark": null,
|
||||||
"is_deleted": 0
|
"status": 1,
|
||||||
},
|
"is_deleted": 0
|
||||||
{
|
},
|
||||||
"id": 13,
|
{
|
||||||
"parent_id": 0,
|
"id": 13,
|
||||||
"name": "供应商",
|
"parent_id": 0,
|
||||||
"kind": 1,
|
"name": "供应商",
|
||||||
"link": null,
|
"kind": 1,
|
||||||
"component": null,
|
"link": null,
|
||||||
"icon": null,
|
"component": "Layout",
|
||||||
"auth": 0,
|
"icon": null,
|
||||||
"sort": 7,
|
"auth": 0,
|
||||||
"remark": null,
|
"sort": 7,
|
||||||
"status": 1,
|
"remark": null,
|
||||||
"is_deleted": 0
|
"status": 1,
|
||||||
},
|
"is_deleted": 0
|
||||||
{
|
},
|
||||||
"id": 14,
|
{
|
||||||
"parent_id": 0,
|
"id": 14,
|
||||||
"name": "系统设置",
|
"parent_id": 0,
|
||||||
"kind": 1,
|
"name": "系统设置",
|
||||||
"link": null,
|
"kind": 1,
|
||||||
"component": "RouteView",
|
"link": null,
|
||||||
"icon": null,
|
"component": "Layout",
|
||||||
"auth": 0,
|
"icon": null,
|
||||||
"sort": 0,
|
"auth": 0,
|
||||||
"remark": null,
|
"sort": 0,
|
||||||
"status": 1,
|
"remark": null,
|
||||||
"is_deleted": 0
|
"status": 1,
|
||||||
},
|
"is_deleted": 0
|
||||||
{
|
},
|
||||||
"id": 15,
|
{
|
||||||
"parent_id": 10,
|
"id": 15,
|
||||||
"name": "新增内修申请",
|
"parent_id": 10,
|
||||||
"kind": 2,
|
"name": "内修工单创建",
|
||||||
"link": null,
|
"kind": 2,
|
||||||
"component": "repair/innerApply",
|
"link": "innerApply",
|
||||||
"icon": null,
|
"component": "repair/innerApply",
|
||||||
"auth": 0,
|
"icon": "",
|
||||||
"sort": 10,
|
"auth": 0,
|
||||||
"remark": null,
|
"sort": 10,
|
||||||
"status": 1,
|
"remark": "",
|
||||||
"is_deleted": 0
|
"status": 1,
|
||||||
},
|
"is_deleted": 0
|
||||||
{
|
},
|
||||||
"id": 16,
|
{
|
||||||
"parent_id": 10,
|
"id": 16,
|
||||||
"name": "新增外修申请",
|
"parent_id": 10,
|
||||||
"kind": 2,
|
"name": "外修工单创建",
|
||||||
"link": null,
|
"kind": 2,
|
||||||
"component": "repair/outerApply",
|
"link": "outerApply",
|
||||||
"icon": null,
|
"component": "repair/outerApply",
|
||||||
"auth": 0,
|
"icon": "",
|
||||||
"sort": 9,
|
"auth": 0,
|
||||||
"remark": null,
|
"sort": 9,
|
||||||
"status": 1,
|
"remark": "",
|
||||||
"is_deleted": 0
|
"status": 1,
|
||||||
},
|
"is_deleted": 0
|
||||||
{
|
},
|
||||||
"id": 17,
|
{
|
||||||
"parent_id": 10,
|
"id": 17,
|
||||||
"name": "我的内修审批",
|
"parent_id": 10,
|
||||||
"kind": 2,
|
"name": "我的内修审批",
|
||||||
"link": null,
|
"kind": 2,
|
||||||
"component": "repair/innerApprove",
|
"link": "innerApprove",
|
||||||
"icon": null,
|
"component": "repair/innerApprove",
|
||||||
"auth": 0,
|
"icon": "",
|
||||||
"sort": 8,
|
"auth": 0,
|
||||||
"remark": null,
|
"sort": 8,
|
||||||
"status": 1,
|
"remark": "",
|
||||||
"is_deleted": 0
|
"status": 1,
|
||||||
},
|
"is_deleted": 0
|
||||||
{
|
},
|
||||||
"id": 18,
|
{
|
||||||
"parent_id": 10,
|
"id": 18,
|
||||||
"name": "我的外修审批",
|
"parent_id": 10,
|
||||||
"kind": 2,
|
"name": "我的外修审批",
|
||||||
"link": null,
|
"kind": 2,
|
||||||
"component": "repair/outerApprove",
|
"link": "outerApprove",
|
||||||
"icon": null,
|
"component": "repair/outerApprove",
|
||||||
"auth": 0,
|
"icon": "",
|
||||||
"sort": 7,
|
"auth": 0,
|
||||||
"remark": null,
|
"sort": 7,
|
||||||
"status": 1,
|
"remark": "",
|
||||||
"is_deleted": 0
|
"status": 1,
|
||||||
},
|
"is_deleted": 0
|
||||||
{
|
},
|
||||||
"id": 19,
|
{
|
||||||
"parent_id": 10,
|
"id": 19,
|
||||||
"name": "内修工单查询",
|
"parent_id": 10,
|
||||||
"kind": 2,
|
"name": "内修工单查询",
|
||||||
"link": null,
|
"kind": 2,
|
||||||
"component": "repair/innerWorkOrder",
|
"link": "innerWorkOrder",
|
||||||
"icon": null,
|
"component": "repair/innerWorkOrder",
|
||||||
"auth": 0,
|
"icon": "",
|
||||||
"sort": 6,
|
"auth": 0,
|
||||||
"remark": null,
|
"sort": 6,
|
||||||
"status": 1,
|
"remark": "",
|
||||||
"is_deleted": 0
|
"status": 1,
|
||||||
},
|
"is_deleted": 0
|
||||||
{
|
},
|
||||||
"id": 20,
|
{
|
||||||
"parent_id": 10,
|
"id": 20,
|
||||||
"name": "外修工单查询",
|
"parent_id": 10,
|
||||||
"kind": 2,
|
"name": "外修工单查询",
|
||||||
"link": null,
|
"kind": 2,
|
||||||
"component": "repair/outerWorkOrder",
|
"link": "outerWorkOrder",
|
||||||
"icon": null,
|
"component": "repair/outerWorkOrder",
|
||||||
"auth": 0,
|
"icon": "",
|
||||||
"sort": 5,
|
"auth": 0,
|
||||||
"remark": null,
|
"sort": 5,
|
||||||
"status": 1,
|
"remark": "",
|
||||||
"is_deleted": 0
|
"status": 1,
|
||||||
},
|
"is_deleted": 0
|
||||||
{
|
},
|
||||||
"id": 21,
|
{
|
||||||
"parent_id": 11,
|
"id": 21,
|
||||||
"name": "装备型谱新增",
|
"parent_id": 11,
|
||||||
"kind": 2,
|
"name": "装备型谱新增",
|
||||||
"link": "",
|
"kind": 2,
|
||||||
"component": "catalogue/add",
|
"link": "spectrumAdd",
|
||||||
"icon": "",
|
"component": "catalogue/spectrumAdd",
|
||||||
"auth": 0,
|
"icon": "",
|
||||||
"sort": 10,
|
"auth": 0,
|
||||||
"remark": "",
|
"sort": 10,
|
||||||
"status": 1,
|
"remark": "",
|
||||||
"is_deleted": 0
|
"status": 1,
|
||||||
},
|
"is_deleted": 0
|
||||||
{
|
},
|
||||||
"id": 22,
|
{
|
||||||
"parent_id": 11,
|
"id": 22,
|
||||||
"name": "装备型谱列表",
|
"parent_id": 11,
|
||||||
"kind": 2,
|
"name": "装备型谱列表",
|
||||||
"link": "",
|
"kind": 2,
|
||||||
"component": "catalogue/list",
|
"link": "spectrumList",
|
||||||
"icon": "",
|
"component": "catalogue/spectrumList",
|
||||||
"auth": 0,
|
"icon": "",
|
||||||
"sort": 9,
|
"auth": 0,
|
||||||
"remark": "",
|
"sort": 9,
|
||||||
"status": 1,
|
"remark": "",
|
||||||
"is_deleted": 0
|
"status": 1,
|
||||||
},
|
"is_deleted": 0
|
||||||
{
|
},
|
||||||
"id": 23,
|
{
|
||||||
"parent_id": 12,
|
"id": 23,
|
||||||
"name": "器材新增",
|
"parent_id": 12,
|
||||||
"kind": 2,
|
"name": "器材新增",
|
||||||
"link": null,
|
"kind": 2,
|
||||||
"component": "equipment/add",
|
"link": "add",
|
||||||
"icon": null,
|
"component": "equipment/add",
|
||||||
"auth": 0,
|
"icon": "",
|
||||||
"sort": 10,
|
"auth": 0,
|
||||||
"remark": null,
|
"sort": 10,
|
||||||
"status": 1,
|
"remark": "",
|
||||||
"is_deleted": 0
|
"status": 1,
|
||||||
},
|
"is_deleted": 0
|
||||||
{
|
},
|
||||||
"id": 24,
|
{
|
||||||
"parent_id": 12,
|
"id": 24,
|
||||||
"name": "器材列表",
|
"parent_id": 12,
|
||||||
"kind": 2,
|
"name": "器材列表",
|
||||||
"link": null,
|
"kind": 2,
|
||||||
"component": "equipment/list",
|
"link": "list",
|
||||||
"icon": null,
|
"component": "equipment/list",
|
||||||
"auth": 0,
|
"icon": "",
|
||||||
"sort": 9,
|
"auth": 0,
|
||||||
"remark": null,
|
"sort": 9,
|
||||||
"status": 1,
|
"remark": "",
|
||||||
"is_deleted": 0
|
"status": 1,
|
||||||
},
|
"is_deleted": 0
|
||||||
{
|
},
|
||||||
"id": 25,
|
{
|
||||||
"parent_id": 13,
|
"id": 25,
|
||||||
"name": "供应商新增",
|
"parent_id": 13,
|
||||||
"kind": 2,
|
"name": "供应商新增",
|
||||||
"link": null,
|
"kind": 2,
|
||||||
"component": "supplier/add",
|
"link": "add",
|
||||||
"icon": null,
|
"component": "supplier/add",
|
||||||
"auth": 0,
|
"icon": "",
|
||||||
"sort": 10,
|
"auth": 0,
|
||||||
"remark": null,
|
"sort": 10,
|
||||||
"status": 1,
|
"remark": "",
|
||||||
"is_deleted": 0
|
"status": 1,
|
||||||
},
|
"is_deleted": 0
|
||||||
{
|
},
|
||||||
"id": 26,
|
{
|
||||||
"parent_id": 13,
|
"id": 26,
|
||||||
"name": "供应商列表",
|
"parent_id": 13,
|
||||||
"kind": 2,
|
"name": "供应商列表",
|
||||||
"link": null,
|
"kind": 2,
|
||||||
"component": "supplier/list",
|
"link": "list",
|
||||||
"icon": null,
|
"component": "supplier/list",
|
||||||
"auth": 0,
|
"icon": "",
|
||||||
"sort": 9,
|
"auth": 0,
|
||||||
"remark": null,
|
"sort": 9,
|
||||||
"status": 1,
|
"remark": "",
|
||||||
"is_deleted": 0
|
"status": 1,
|
||||||
},
|
"is_deleted": 0
|
||||||
{
|
},
|
||||||
"id": 27,
|
{
|
||||||
"parent_id": 14,
|
"id": 27,
|
||||||
"name": "用户管理",
|
"parent_id": 14,
|
||||||
"kind": 2,
|
"name": "用户管理",
|
||||||
"link": null,
|
"kind": 2,
|
||||||
"component": "system/user",
|
"link": "user",
|
||||||
"icon": null,
|
"component": "system/user",
|
||||||
"auth": 0,
|
"icon": "",
|
||||||
"sort": 10,
|
"auth": 0,
|
||||||
"remark": null,
|
"sort": 9,
|
||||||
"status": 1,
|
"remark": "",
|
||||||
"is_deleted": 0
|
"status": 1,
|
||||||
},
|
"is_deleted": 0
|
||||||
{
|
},
|
||||||
"id": 28,
|
{
|
||||||
"parent_id": 14,
|
"id": 28,
|
||||||
"name": "角色管理",
|
"parent_id": 14,
|
||||||
"kind": 2,
|
"name": "角色管理",
|
||||||
"link": null,
|
"kind": 2,
|
||||||
"component": "system/role",
|
"link": "role",
|
||||||
"icon": null,
|
"component": "system/role",
|
||||||
"auth": 0,
|
"icon": "",
|
||||||
"sort": 9,
|
"auth": 0,
|
||||||
"remark": null,
|
"sort": 8,
|
||||||
"status": 1,
|
"remark": "",
|
||||||
"is_deleted": 0
|
"status": 1,
|
||||||
},
|
"is_deleted": 0
|
||||||
{
|
},
|
||||||
"id": 29,
|
{
|
||||||
"parent_id": 14,
|
"id": 29,
|
||||||
"name": "部门管理",
|
"parent_id": 14,
|
||||||
"kind": 2,
|
"name": "部门管理",
|
||||||
"link": null,
|
"kind": 2,
|
||||||
"component": "system/dept",
|
"link": null,
|
||||||
"icon": null,
|
"component": "system/dept",
|
||||||
"auth": 0,
|
"icon": null,
|
||||||
"sort": 8,
|
"auth": 0,
|
||||||
"remark": null,
|
"sort": 8,
|
||||||
"status": 1,
|
"remark": null,
|
||||||
"is_deleted": 1
|
"status": 1,
|
||||||
},
|
"is_deleted": 1
|
||||||
{
|
},
|
||||||
"id": 30,
|
{
|
||||||
"parent_id": 14,
|
"id": 30,
|
||||||
"name": "菜单管理",
|
"parent_id": 14,
|
||||||
"kind": 2,
|
"name": "菜单管理",
|
||||||
"link": "",
|
"kind": 2,
|
||||||
"component": "system/menu",
|
"link": "menu",
|
||||||
"icon": "",
|
"component": "system/menu",
|
||||||
"auth": 0,
|
"icon": "",
|
||||||
"sort": 8,
|
"auth": 0,
|
||||||
"remark": "",
|
"sort": 7,
|
||||||
"status": 1,
|
"remark": "",
|
||||||
"is_deleted": 0
|
"status": 1,
|
||||||
}
|
"is_deleted": 0
|
||||||
]
|
},
|
||||||
|
{
|
||||||
|
"id": 33,
|
||||||
|
"parent_id": 10,
|
||||||
|
"name": "维修工单列表",
|
||||||
|
"kind": 2,
|
||||||
|
"link": "repairWorkOrder",
|
||||||
|
"component": "repair/repairWorkOrder",
|
||||||
|
"icon": null,
|
||||||
|
"auth": 0,
|
||||||
|
"sort": 4,
|
||||||
|
"remark": null,
|
||||||
|
"status": 1,
|
||||||
|
"is_deleted": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 34,
|
||||||
|
"parent_id": 11,
|
||||||
|
"name": "承修单位新增",
|
||||||
|
"kind": 2,
|
||||||
|
"link": "repairAdd",
|
||||||
|
"component": "catalogue/repairAdd",
|
||||||
|
"icon": null,
|
||||||
|
"auth": 0,
|
||||||
|
"sort": 8,
|
||||||
|
"remark": null,
|
||||||
|
"status": 1,
|
||||||
|
"is_deleted": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 35,
|
||||||
|
"parent_id": 11,
|
||||||
|
"name": "承修单位",
|
||||||
|
"kind": 2,
|
||||||
|
"link": "repairList",
|
||||||
|
"component": "catalogue/repairList",
|
||||||
|
"icon": null,
|
||||||
|
"auth": 0,
|
||||||
|
"sort": 7,
|
||||||
|
"remark": null,
|
||||||
|
"status": 1,
|
||||||
|
"is_deleted": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 36,
|
||||||
|
"parent_id": 11,
|
||||||
|
"name": "承制单位新增",
|
||||||
|
"kind": 2,
|
||||||
|
"link": "systemAdd",
|
||||||
|
"component": "catalogue/systemAdd",
|
||||||
|
"icon": null,
|
||||||
|
"auth": 0,
|
||||||
|
"sort": 6,
|
||||||
|
"remark": null,
|
||||||
|
"status": 1,
|
||||||
|
"is_deleted": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 37,
|
||||||
|
"parent_id": 11,
|
||||||
|
"name": "承制单位",
|
||||||
|
"kind": 2,
|
||||||
|
"link": "systemList",
|
||||||
|
"component": "catalogue/systemList",
|
||||||
|
"icon": null,
|
||||||
|
"auth": 0,
|
||||||
|
"sort": 5,
|
||||||
|
"remark": null,
|
||||||
|
"status": 1,
|
||||||
|
"is_deleted": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 38,
|
||||||
|
"parent_id": 14,
|
||||||
|
"name": "单位管理",
|
||||||
|
"kind": 2,
|
||||||
|
"link": "dept",
|
||||||
|
"component": "system/dept",
|
||||||
|
"icon": null,
|
||||||
|
"auth": 0,
|
||||||
|
"sort": 10,
|
||||||
|
"remark": null,
|
||||||
|
"status": 1,
|
||||||
|
"is_deleted": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 39,
|
||||||
|
"parent_id": 14,
|
||||||
|
"name": "通知列表",
|
||||||
|
"kind": 2,
|
||||||
|
"link": "notice",
|
||||||
|
"component": "system/notice",
|
||||||
|
"icon": null,
|
||||||
|
"auth": 0,
|
||||||
|
"sort": 6,
|
||||||
|
"remark": null,
|
||||||
|
"status": 1,
|
||||||
|
"is_deleted": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 40,
|
||||||
|
"parent_id": 14,
|
||||||
|
"name": "故障库",
|
||||||
|
"kind": 2,
|
||||||
|
"link": "fault",
|
||||||
|
"component": "system/fault",
|
||||||
|
"icon": null,
|
||||||
|
"auth": 0,
|
||||||
|
"sort": 5,
|
||||||
|
"remark": null,
|
||||||
|
"status": 1,
|
||||||
|
"is_deleted": 0
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -1,37 +0,0 @@
|
|||||||
package lib
|
|
||||||
|
|
||||||
import (
|
|
||||||
"ArmedPolice/utils"
|
|
||||||
"testing"
|
|
||||||
)
|
|
||||||
|
|
||||||
type (
|
|
||||||
structForSysConfig struct {
|
|
||||||
ID uint64 `json:"id"`
|
|
||||||
Kind int `json:"kind"`
|
|
||||||
Name string `json:"name"`
|
|
||||||
Key string `json:"key"`
|
|
||||||
Value string `json:"value"`
|
|
||||||
IsDeleted int `json:"is_deleted"`
|
|
||||||
}
|
|
||||||
structForSysMenu struct {
|
|
||||||
ID int `json:"id"`
|
|
||||||
ParentId int `json:"parent_id"`
|
|
||||||
Name string `json:"name"`
|
|
||||||
Kind int `json:"kind"`
|
|
||||||
Link string `json:"link"`
|
|
||||||
Component string `json:"component"`
|
|
||||||
Icon string `json:"icon"`
|
|
||||||
Auth int `json:"auth"`
|
|
||||||
Sort int `json:"sort"`
|
|
||||||
Remark string `json:"remark"`
|
|
||||||
Status int `json:"status"`
|
|
||||||
IsDeleted int `json:"is_deleted"`
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
func TestLoadConfig(t *testing.T) {
|
|
||||||
values := make([]*structForSysMenu, 0)
|
|
||||||
LoadConfig("../json/sys_menu.json", &values)
|
|
||||||
t.Log(utils.AnyToJSON(values))
|
|
||||||
}
|
|
@ -43,7 +43,6 @@ func (this *Router) registerWeb() {
|
|||||||
func (this *Router) registerAPI() {
|
func (this *Router) registerAPI() {
|
||||||
apiPrefix := "/api"
|
apiPrefix := "/api"
|
||||||
g := this.handler.Group(apiPrefix)
|
g := this.handler.Group(apiPrefix)
|
||||||
g.Use()
|
|
||||||
// 登录验证
|
// 登录验证
|
||||||
g.Use(NeedLogin(AddSkipperURL([]string{
|
g.Use(NeedLogin(AddSkipperURL([]string{
|
||||||
apiPrefix + "/v1/account/login",
|
apiPrefix + "/v1/account/login",
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package lib
|
package utils
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
Reference in New Issue
Block a user