|
@@ -1,19 +1,125 @@
|
|
|
package api
|
|
|
|
|
|
import (
|
|
|
+ "context"
|
|
|
"gadmin/config"
|
|
|
+ "gadmin/internal/admin/forms"
|
|
|
"gadmin/internal/admin/service"
|
|
|
+ "gadmin/internal/gorm/query"
|
|
|
+ "gadmin/utility/character"
|
|
|
"gadmin/utility/serializer"
|
|
|
"github.com/gin-gonic/gin"
|
|
|
+ "github.com/sirupsen/logrus"
|
|
|
"os"
|
|
|
+ "sort"
|
|
|
+ "strings"
|
|
|
+)
|
|
|
+
|
|
|
+type (
|
|
|
+ Map = map[string]interface{}
|
|
|
)
|
|
|
|
|
|
func MenuDynamic(c *gin.Context) {
|
|
|
|
|
|
- type (
|
|
|
- Map = map[string]interface{}
|
|
|
- )
|
|
|
+ list, err := GetRoleMenuList(c)
|
|
|
+ if err != nil {
|
|
|
+ c.JSON(200, ErrorResponse(err))
|
|
|
+ return
|
|
|
+ }
|
|
|
+ c.JSON(200, serializer.Suc(list, "获取成功"))
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
+func GetRoleMenuList(c *gin.Context) ([]*forms.Menu, error) {
|
|
|
+ //lists := GetMenuList(c)
|
|
|
+ lists, err := service.Menu.GetMenuList()
|
|
|
+ if err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ t := c.GetHeader("authorization")
|
|
|
+ for _, item := range lists {
|
|
|
+ if strings.Contains(item.Name, "{access-token}") {
|
|
|
+ item.Name = strings.ReplaceAll(item.Name, "{access-token}", t)
|
|
|
+ }
|
|
|
+ if len(item.Children) > 0 {
|
|
|
+ for _, children := range item.Children {
|
|
|
+ if strings.Contains(children.Name, "{access-token}") {
|
|
|
+ children.Name = strings.ReplaceAll(children.Name, "{access-token}", t)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 获取角色可查看的页面
|
|
|
+ roleId, _ := c.Get("admin_role_id")
|
|
|
+
|
|
|
+ // 超管查看所有页面
|
|
|
+ if config.IsSuperRole(roleId.(int64)) {
|
|
|
+ return lists, nil
|
|
|
+ }
|
|
|
+ var rolePages []int32
|
|
|
+ rdb := query.Use(config.DB).AdminRoleMenu
|
|
|
+ m := rdb.WithContext(context.Background())
|
|
|
+ err = m.Where(rdb.RoleID.Eq(int32(roleId.(int64)))).Pluck(rdb.PageID, &rolePages)
|
|
|
+ if err != nil {
|
|
|
+ logrus.Error("AdminRole... err:%+v", err)
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ newList := make([]*forms.Menu, 0)
|
|
|
+ if len(rolePages) == 0 { // 没有配置权限默认全部
|
|
|
+ newList = lists
|
|
|
+ } else {
|
|
|
+ tmpPages := make(map[int32]*forms.Menu)
|
|
|
|
|
|
+ for _, item := range lists {
|
|
|
+ if character.InSlice(rolePages, item.Id) {
|
|
|
+ tmpPages[item.Id] = &forms.Menu{
|
|
|
+ Id: item.Id,
|
|
|
+ Component: item.Component,
|
|
|
+ Meta: item.Meta,
|
|
|
+ Name: item.Name,
|
|
|
+ Path: item.Name,
|
|
|
+ Redirect: item.Redirect,
|
|
|
+ Children: []*forms.Menu{},
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if len(item.Children) > 0 {
|
|
|
+ for _, children := range item.Children {
|
|
|
+ if !character.InSlice(rolePages, children.Id) {
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ if _, ok2 := tmpPages[item.Id]; ok2 {
|
|
|
+ tmpPages[item.Id].Children = append(tmpPages[item.Id].Children, children)
|
|
|
+ } else {
|
|
|
+ tmpPages[item.Id] = &forms.Menu{
|
|
|
+ Id: item.Id,
|
|
|
+ Component: item.Component,
|
|
|
+ Meta: item.Meta,
|
|
|
+ Name: item.Name,
|
|
|
+ Path: item.Name,
|
|
|
+ Redirect: item.Redirect,
|
|
|
+ Children: []*forms.Menu{children},
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ for _, item := range tmpPages {
|
|
|
+ sort.Slice(item.Children, func(i, j int) bool {
|
|
|
+ return item.Children[i].Meta.Sort < item.Children[j].Meta.Sort
|
|
|
+ })
|
|
|
+ newList = append(newList, item)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 排序
|
|
|
+ sort.Slice(newList, func(i, j int) bool {
|
|
|
+ return newList[i].Meta.Sort < newList[j].Meta.Sort
|
|
|
+ })
|
|
|
+ return newList, nil
|
|
|
+}
|
|
|
+
|
|
|
+func GetMenuList(c *gin.Context) []Map {
|
|
|
var (
|
|
|
lists []Map
|
|
|
localHidden = true // 本地显示的菜单
|
|
@@ -25,6 +131,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
|
|
|
// 控制台
|
|
|
lists = append(lists, Map{
|
|
|
+ "id": 1,
|
|
|
"path": "/dashboard",
|
|
|
"name": "Dashboard",
|
|
|
"component": "LAYOUT",
|
|
@@ -35,6 +142,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
},
|
|
|
"children": []Map{
|
|
|
{
|
|
|
+ "id": 1001,
|
|
|
"path": "console",
|
|
|
"name": "dashboard_console",
|
|
|
"component": "/dashboard/console/console",
|
|
@@ -47,6 +155,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
|
|
|
// 玩家管理
|
|
|
lists = append(lists, Map{
|
|
|
+ "id": 2,
|
|
|
"path": "/account",
|
|
|
"name": "Account",
|
|
|
"component": "LAYOUT",
|
|
@@ -58,6 +167,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
},
|
|
|
"children": []Map{
|
|
|
{
|
|
|
+ "id": 2001,
|
|
|
"path": "account-list",
|
|
|
"name": "account-list",
|
|
|
"component": "/account/accountList/index",
|
|
@@ -66,6 +176,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
+ "id": 2002,
|
|
|
"path": "account-info/:id?",
|
|
|
"name": "account-info",
|
|
|
"component": "/account/accountList/info",
|
|
@@ -76,6 +187,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
+ "id": 2003,
|
|
|
"path": "account-search",
|
|
|
"name": "account-search",
|
|
|
"component": "/account/accountList/search",
|
|
@@ -153,6 +265,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
if config.IsSuperRole(service.User.GetUserRoleId(c)) {
|
|
|
// 权限管理
|
|
|
lists = append(lists, Map{
|
|
|
+ "id": 3,
|
|
|
"path": "/permission",
|
|
|
"name": "Permission",
|
|
|
"component": "LAYOUT",
|
|
@@ -163,15 +276,17 @@ func MenuDynamic(c *gin.Context) {
|
|
|
"sort": 1,
|
|
|
},
|
|
|
"children": []Map{
|
|
|
- //{
|
|
|
- // "path": "menu",
|
|
|
- // "name": "permission_menu",
|
|
|
- // "component": "/permission/menu/menu",
|
|
|
- // "meta": Map{
|
|
|
- // "title": "菜单权限",
|
|
|
- // },
|
|
|
- //},
|
|
|
{
|
|
|
+ "id": 3003,
|
|
|
+ "path": "menu",
|
|
|
+ "name": "permission_menu",
|
|
|
+ "component": "/permission/menu/menu",
|
|
|
+ "meta": Map{
|
|
|
+ "title": "菜单权限",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "id": 3001,
|
|
|
"path": "user",
|
|
|
"name": "permission_user",
|
|
|
"component": "/permission/user/user",
|
|
@@ -180,6 +295,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
+ "id": 3002,
|
|
|
"path": "role",
|
|
|
"name": "permission_role",
|
|
|
"component": "/permission/role/role",
|
|
@@ -193,6 +309,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
|
|
|
// 充值管理
|
|
|
/*lists = append(lists, Map{
|
|
|
+ "id": 4,
|
|
|
"path": "/recharge",
|
|
|
"name": "Recharge",
|
|
|
"component": "LAYOUT",
|
|
@@ -204,6 +321,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
},
|
|
|
"children": []Map{
|
|
|
{
|
|
|
+ "id": 4001,
|
|
|
"path": "recharge-list",
|
|
|
"name": "recharge-list",
|
|
|
"component": "/recharge/rechargeList/index",
|
|
@@ -212,6 +330,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
+ "id": 4002,
|
|
|
"path": "recharge-dailyStatistics",
|
|
|
"name": "recharge-dailyStatistics",
|
|
|
"component": "/recharge/dailyStatistics/index",
|
|
@@ -220,6 +339,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
+ "id": 4003,
|
|
|
"path": "recharge-ordersSettle",
|
|
|
"name": "recharge-ordersSettle",
|
|
|
"component": "/recharge/ordersSettle/index",
|
|
@@ -229,6 +349,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
+ "id": 4004,
|
|
|
"path": "recharge-abnormalOrder",
|
|
|
"name": "recharge-abnormalOrder",
|
|
|
"component": "/recharge/abnormalOrder/index",
|
|
@@ -242,6 +363,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
|
|
|
// 排行榜
|
|
|
/*lists = append(lists, Map{
|
|
|
+ "id": 5,
|
|
|
"path": "/ranking",
|
|
|
"name": "Ranking",
|
|
|
"component": "LAYOUT",
|
|
@@ -253,6 +375,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
},
|
|
|
"children": []Map{
|
|
|
{
|
|
|
+ "id": 5001,
|
|
|
"path": "recharge-ranking",
|
|
|
"name": "recharge-ranking",
|
|
|
"component": "/ranking/recharge/index",
|
|
@@ -261,6 +384,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
+ "id": 5002,
|
|
|
"path": "diamond-ranking",
|
|
|
"name": "diamond-ranking",
|
|
|
"component": "/ranking/diamond/index",
|
|
@@ -269,6 +393,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
+ "id": 5003,
|
|
|
"path": "level-ranking",
|
|
|
"name": "level-ranking",
|
|
|
"component": "/ranking/level/index",
|
|
@@ -277,6 +402,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
+ "id": 5004,
|
|
|
"path": "elrank-ranking",
|
|
|
"name": "elrank-ranking",
|
|
|
"component": "/ranking/elrank/index",
|
|
@@ -285,6 +411,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
+ "id": 5005,
|
|
|
"path": "duel-ranking",
|
|
|
"name": "duel-ranking",
|
|
|
"component": "/ranking/duel/index",
|
|
@@ -293,6 +420,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
+ "id": 5006,
|
|
|
"path": "gudong-ranking",
|
|
|
"name": "gudong-ranking",
|
|
|
"component": "/ranking/gudong/index",
|
|
@@ -301,6 +429,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
+ "id": 5007,
|
|
|
"path": "idiom-ranking",
|
|
|
"name": "idiom-ranking",
|
|
|
"component": "/ranking/idiom/index",
|
|
@@ -309,6 +438,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
+ "id": 5008,
|
|
|
"path": "boss-ranking",
|
|
|
"name": "boss-ranking",
|
|
|
"component": "/ranking/boss/index",
|
|
@@ -317,6 +447,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
+ "id": 5009,
|
|
|
"path": "adv-ranking",
|
|
|
"name": "adv-ranking",
|
|
|
"component": "/ranking/adv/index",
|
|
@@ -325,6 +456,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
+ "id": 5010,
|
|
|
"path": "login-ranking",
|
|
|
"name": "login-ranking",
|
|
|
"component": "/ranking/login/index",
|
|
@@ -337,6 +469,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
|
|
|
// 数据统计
|
|
|
/*lists = append(lists, Map{
|
|
|
+ "id": 6,
|
|
|
"path": "/echarts",
|
|
|
"name": "Echarts",
|
|
|
"component": "LAYOUT",
|
|
@@ -348,6 +481,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
},
|
|
|
"children": []Map{
|
|
|
{
|
|
|
+ "id": 6001,
|
|
|
"path": "login-echarts",
|
|
|
"name": "login-echarts",
|
|
|
"component": "/echarts/login/index",
|
|
@@ -356,6 +490,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
+ "id": 6002,
|
|
|
"path": "chapter-echarts",
|
|
|
"name": "chapter-echarts",
|
|
|
"component": "/echarts/chapter/index",
|
|
@@ -364,6 +499,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
+ "id": 6003,
|
|
|
"path": "basic-echarts",
|
|
|
"name": "basic-echarts",
|
|
|
"component": "/echarts/basic/index",
|
|
@@ -372,6 +508,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
+ "id": 6004,
|
|
|
"path": "adv-echarts",
|
|
|
"name": "adv-echarts",
|
|
|
"component": "/echarts/adv/index",
|
|
@@ -380,6 +517,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
+ "id": 6005,
|
|
|
"path": "echarts-tests",
|
|
|
"name": "echarts-tests",
|
|
|
"component": "/echarts/adv/index2",
|
|
@@ -389,6 +527,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
+ "id": 6006,
|
|
|
"path": "goods-echarts",
|
|
|
"name": "goods-echarts",
|
|
|
"component": "/echarts/goods/index",
|
|
@@ -397,6 +536,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
+ "id": 6007,
|
|
|
"path": "gudong-echarts",
|
|
|
"name": "gudong-echarts",
|
|
|
"component": "/echarts/gudong/index",
|
|
@@ -405,6 +545,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
+ "id": 6008,
|
|
|
"path": "duel-echarts",
|
|
|
"name": "duel-echarts",
|
|
|
"component": "/echarts/duel/index",
|
|
@@ -413,6 +554,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
+ "id": 6009,
|
|
|
"path": "expedition-echarts",
|
|
|
"name": "expedition-echarts",
|
|
|
"component": "/echarts/expedition/index",
|
|
@@ -421,6 +563,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
+ "id": 6010,
|
|
|
"path": "idiom-echarts",
|
|
|
"name": "idiom-echarts",
|
|
|
"component": "/echarts/idiom/index",
|
|
@@ -429,6 +572,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
+ "id": 6011,
|
|
|
"path": "boss-echarts",
|
|
|
"name": "boss-echarts",
|
|
|
"component": "/echarts/boss/index",
|
|
@@ -437,6 +581,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
+ "id": 6012,
|
|
|
"path": "seven-echarts",
|
|
|
"name": "seven-echarts",
|
|
|
"component": "/echarts/seven/index",
|
|
@@ -445,6 +590,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
+ "id": 6013,
|
|
|
"path": "disconnect-echarts",
|
|
|
"name": "disconnect-echarts",
|
|
|
"component": "/echarts/disconnect/index",
|
|
@@ -453,6 +599,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
+ "id": 6014,
|
|
|
"path": "gem-echarts",
|
|
|
"name": "gem-echarts",
|
|
|
"component": "/echarts/gem/index",
|
|
@@ -461,6 +608,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
+ "id": 6015,
|
|
|
"path": "limitgift-echarts",
|
|
|
"name": "limitgift-echarts",
|
|
|
"component": "/echarts/limitgift/index",
|
|
@@ -469,6 +617,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
+ "id": 6016,
|
|
|
"path": "treasure-echarts",
|
|
|
"name": "treasure-echarts",
|
|
|
"component": "/echarts/treasure/index",
|
|
@@ -477,6 +626,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
+ "id": 6017,
|
|
|
"path": "grandmaster-echarts",
|
|
|
"name": "grandmaster-echarts",
|
|
|
"component": "/echarts/grandmaster/index",
|
|
@@ -485,6 +635,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
+ "id": 6018,
|
|
|
"path": "gradeDistribution-echarts",
|
|
|
"name": "gradeDistribution-echarts",
|
|
|
"component": "/echarts/gradeDistribution/index",
|
|
@@ -493,6 +644,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
+ "id": 6019,
|
|
|
"path": "roles-echarts",
|
|
|
"name": "roles-echarts",
|
|
|
"component": "/echarts/roles/index",
|
|
@@ -501,6 +653,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
+ "id": 6020,
|
|
|
"path": "heroLevelDistribution-echarts",
|
|
|
"name": "heroLevelDistribution-echarts",
|
|
|
"component": "/echarts/heroLevelDistribution/index",
|
|
@@ -509,6 +662,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
+ "id": 6021,
|
|
|
"path": "levelOutput-echarts",
|
|
|
"name": "levelOutput-echarts",
|
|
|
"component": "/echarts/levelOutput/index",
|
|
@@ -521,6 +675,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
|
|
|
gameToolMap := make([]Map, 0)
|
|
|
gameToolMap = append(gameToolMap, Map{
|
|
|
+ "id": 7001,
|
|
|
"path": "config",
|
|
|
"name": "system_config",
|
|
|
"component": "/system/config/config",
|
|
@@ -528,6 +683,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
"title": "服务配置",
|
|
|
},
|
|
|
}, Map{
|
|
|
+ "id": 7002,
|
|
|
"path": "deploy",
|
|
|
"name": "system_deploy",
|
|
|
"component": "/deploy/index",
|
|
@@ -558,6 +714,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
|
|
|
// 游戏工具
|
|
|
lists = append(lists, Map{
|
|
|
+ "id": 7,
|
|
|
"path": "/tool",
|
|
|
"name": "Tool",
|
|
|
"component": "LAYOUT",
|
|
@@ -572,6 +729,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
|
|
|
// 邮件通知
|
|
|
/*lists = append(lists, Map{
|
|
|
+ "id": 8,
|
|
|
"path": "/email",
|
|
|
"name": "email",
|
|
|
"component": "LAYOUT",
|
|
@@ -584,6 +742,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
},
|
|
|
"children": []Map{
|
|
|
{
|
|
|
+ "id": 8001,
|
|
|
"path": "index",
|
|
|
"name": "email_index",
|
|
|
"component": "/email/index",
|
|
@@ -596,6 +755,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
|
|
|
// 邮件通知
|
|
|
/*lists = append(lists, Map{
|
|
|
+ "id": 9,
|
|
|
"path": "/Mail",
|
|
|
"name": "mail",
|
|
|
"component": "LAYOUT",
|
|
@@ -608,6 +768,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
},
|
|
|
"children": []Map{
|
|
|
{
|
|
|
+ "id": 9001,
|
|
|
"path": "index",
|
|
|
"name": "mail_index",
|
|
|
"component": "/mail/index",
|
|
@@ -620,6 +781,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
|
|
|
// 广播通知
|
|
|
/*lists = append(lists, Map{
|
|
|
+ "id": 10,
|
|
|
"path": "/notice",
|
|
|
"name": "notice",
|
|
|
"component": "LAYOUT",
|
|
@@ -633,6 +795,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
},
|
|
|
"children": []Map{
|
|
|
{
|
|
|
+ "id": 10001,
|
|
|
"path": "noticev2_index", // ?
|
|
|
"name": "noticev2_index",
|
|
|
"component": "/noticev2/index",
|
|
@@ -654,6 +817,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
})*/
|
|
|
// 客服记录
|
|
|
/*lists = append(lists, Map{
|
|
|
+ "id": 11,
|
|
|
"path": "/chatLog",
|
|
|
"name": "ChatLog",
|
|
|
"component": "LAYOUT",
|
|
@@ -665,6 +829,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
},
|
|
|
"children": []Map{
|
|
|
{
|
|
|
+ "id": 11001,
|
|
|
"path": "chatLog-index",
|
|
|
"name": "chatLog-index",
|
|
|
"component": "/chatLog/index",
|
|
@@ -676,6 +841,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
})*/
|
|
|
// 兑换码
|
|
|
/*lists = append(lists, Map{
|
|
|
+ "id": 12,
|
|
|
"path": "/cdk",
|
|
|
"name": "cdk",
|
|
|
"component": "LAYOUT",
|
|
@@ -689,6 +855,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
},
|
|
|
"children": []Map{
|
|
|
{
|
|
|
+ "id": 12001,
|
|
|
"path": "index",
|
|
|
"name": "cdk_index",
|
|
|
"component": "/cdk/index",
|
|
@@ -698,6 +865,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
+ "id": 12002,
|
|
|
"path": "cdk-redeemCodeList/:sn?",
|
|
|
"name": "cdk-redeemCodeList",
|
|
|
"component": "/cdk/redeemCodeList",
|
|
@@ -712,6 +880,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
|
|
|
// 设置页面
|
|
|
lists = append(lists, Map{
|
|
|
+ "id": 13,
|
|
|
"path": "/setting",
|
|
|
"name": "Setting",
|
|
|
"component": "LAYOUT",
|
|
@@ -724,6 +893,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
"hidden": false,
|
|
|
"children": []Map{
|
|
|
{
|
|
|
+ "id": 13001,
|
|
|
"path": "account",
|
|
|
"name": "setting-account",
|
|
|
"component": "/setting/account/account",
|
|
@@ -740,6 +910,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
// },
|
|
|
//},
|
|
|
{
|
|
|
+ "id": 13002,
|
|
|
"path": "log",
|
|
|
"name": "log-index",
|
|
|
"component": "/log/index",
|
|
@@ -748,6 +919,7 @@ func MenuDynamic(c *gin.Context) {
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
+ "id": 13003,
|
|
|
"path": "log-view/:id?",
|
|
|
"name": "log-view",
|
|
|
"component": "/log/view",
|
|
@@ -759,10 +931,53 @@ func MenuDynamic(c *gin.Context) {
|
|
|
},
|
|
|
},
|
|
|
})
|
|
|
+ t := c.GetHeader("authorization")
|
|
|
+ // 管理后台切换
|
|
|
+ lists = append(lists, Map{
|
|
|
+ "id": 14,
|
|
|
+ "path": "/server_select",
|
|
|
+ "name": "ServerSelect",
|
|
|
+ "component": "LAYOUT",
|
|
|
+ "meta": Map{
|
|
|
+ "icon": "ServerOutline",
|
|
|
+ "title": "管理后台切换",
|
|
|
+ "sort": 5,
|
|
|
+ },
|
|
|
+ "children": []Map{
|
|
|
+ {
|
|
|
+ "id": 14001,
|
|
|
+ "path": "/redirect",
|
|
|
+ "name": "http://101.43.249.6:7004/gadmin/?access-token=%s" + t,
|
|
|
+ "component": "LAYOUT",
|
|
|
+ "meta": Map{
|
|
|
+ "title": "魔君测试服",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "id": 14002,
|
|
|
+ "path": "/redirect",
|
|
|
+ "name": "http://101.43.249.6:7006/cadmin/?access-token=" + t,
|
|
|
+ "component": "LAYOUT",
|
|
|
+ "meta": Map{
|
|
|
+ "title": "空之契约测试服",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "id": 14003,
|
|
|
+ "path": "/redirect",
|
|
|
+ "name": "http://192.168.0.186:8253/gadmin/?access-token=" + t,
|
|
|
+ "component": "LAYOUT",
|
|
|
+ "meta": Map{
|
|
|
+ "title": "魔君本地",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ },
|
|
|
+ })
|
|
|
|
|
|
// 文档
|
|
|
if localHidden == false {
|
|
|
lists = append(lists, Map{
|
|
|
+ "id": 15,
|
|
|
"path": "/external",
|
|
|
"name": "https://www.naiveui.com",
|
|
|
"component": "LAYOUT",
|
|
@@ -773,8 +988,6 @@ func MenuDynamic(c *gin.Context) {
|
|
|
},
|
|
|
"children": []Map{},
|
|
|
})
|
|
|
-
|
|
|
}
|
|
|
-
|
|
|
- c.JSON(200, serializer.Suc(lists, "获取成功"))
|
|
|
+ return lists
|
|
|
}
|