menu.go 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920
  1. package api
  2. import (
  3. "gadmin/config"
  4. "gadmin/internal/admin/forms"
  5. "gadmin/internal/admin/service"
  6. "gadmin/utility/serializer"
  7. "gadmin/utility/token"
  8. "github.com/gin-gonic/gin"
  9. "os"
  10. )
  11. type (
  12. Map = map[string]interface{}
  13. )
  14. func MenuDynamic(c *gin.Context) {
  15. systemId := token.GetSystemId(c)
  16. t := c.GetHeader("authorization")
  17. roleId, _ := c.Get("admin_role_id")
  18. list, err := service.Menu.GetRoleMenuList(systemId, roleId.(int64), t)
  19. if err != nil {
  20. c.JSON(200, ErrorResponse(err))
  21. return
  22. }
  23. c.JSON(200, serializer.Suc(list, "获取成功"))
  24. return
  25. }
  26. func GetAllMenuList(c *gin.Context) (map[int32][]*forms.Menu, error) {
  27. systems, err := service.AdminRole.GetAllSystem()
  28. if err != nil {
  29. return nil, err
  30. }
  31. t := c.GetHeader("authorization")
  32. roleId, _ := c.Get("admin_role_id")
  33. systemMap := make(map[int32][]*forms.Menu)
  34. for _, sys := range systems {
  35. menus, err := service.Menu.GetRoleMenuList(sys.ID, roleId.(int64), t)
  36. if err != nil {
  37. return nil, err
  38. }
  39. systemMap[sys.ID] = menus
  40. }
  41. return systemMap, nil
  42. }
  43. func GetMenuList(c *gin.Context) []Map {
  44. var (
  45. lists []Map
  46. localHidden = true // 本地显示的菜单
  47. )
  48. if os.Getenv("ADMIN_IS_LOCAL") == "1" {
  49. localHidden = false
  50. }
  51. // 控制台
  52. lists = append(lists, Map{
  53. "id": 1,
  54. "path": "/dashboard",
  55. "name": "Dashboard",
  56. "component": "LAYOUT",
  57. "redirect": "/dashboard/console",
  58. "meta": Map{
  59. "title": "Dashboard",
  60. "icon": "DashboardOutlined",
  61. },
  62. "children": []Map{
  63. {
  64. "id": 1001,
  65. "path": "console",
  66. "name": "dashboard_console",
  67. "component": "/dashboard/console/console",
  68. "meta": Map{
  69. "title": "主控台",
  70. },
  71. },
  72. },
  73. })
  74. // 玩家管理
  75. lists = append(lists, Map{
  76. "id": 2,
  77. "path": "/account",
  78. "name": "Account",
  79. "component": "LAYOUT",
  80. "redirect": "/account/account-list",
  81. "meta": Map{
  82. "icon": "UserOutlined",
  83. "title": "玩家管理",
  84. "sort": 2,
  85. },
  86. "children": []Map{
  87. {
  88. "id": 2001,
  89. "path": "account-list",
  90. "name": "account-list",
  91. "component": "/account/accountList/index",
  92. "meta": Map{
  93. "title": "玩家列表",
  94. },
  95. },
  96. {
  97. "id": 2002,
  98. "path": "account-info/:id?",
  99. "name": "account-info",
  100. "component": "/account/accountList/info",
  101. "meta": Map{
  102. "title": "基础详情",
  103. "hidden": true,
  104. "activeMenu": "account-list",
  105. },
  106. },
  107. {
  108. "id": 2003,
  109. "path": "account-search",
  110. "name": "account-search",
  111. "component": "/account/accountList/search",
  112. "meta": Map{
  113. "title": "全服查找",
  114. },
  115. },
  116. /*{
  117. "path": "account-banLogs",
  118. "name": "account-banLogs",
  119. "component": "/account/accountList/banLogs",
  120. "meta": Map{
  121. "title": "拉黑记录",
  122. },
  123. },
  124. {
  125. "path": "retrofit-list",
  126. "name": "retrofit-list",
  127. "component": "/retrofit/index",
  128. "meta": Map{
  129. "title": "配装模板",
  130. },
  131. },
  132. {
  133. "path": "consumption-details",
  134. "name": "consumption-details",
  135. "component": "/recharge/consumption/index",
  136. "meta": Map{
  137. "title": "消费变动记录",
  138. },
  139. },
  140. {
  141. "path": "consumption-statistics",
  142. "name": "consumption-statistics",
  143. "component": "/recharge/consumptionStatistics/index",
  144. "meta": Map{
  145. "title": "消费统计",
  146. },
  147. },
  148. {
  149. "path": "game-data-alarm",
  150. "name": "game-data-alarm",
  151. "component": "/account/gameDataAlarm/index",
  152. "meta": Map{
  153. "title": "游戏异常",
  154. },
  155. },
  156. {
  157. "path": "game-cheating-alarm",
  158. "name": "game-cheating-alarm",
  159. "component": "/account/gameCheatingAlarm/index",
  160. "meta": Map{
  161. "title": "作弊数据筛选",
  162. },
  163. },
  164. {
  165. "path": "chat-report-list",
  166. "name": "chat-report-list",
  167. "component": "/account/chatReportList/index",
  168. "meta": Map{
  169. "title": "聊天举报记录",
  170. },
  171. },
  172. {
  173. "path": "chat-log-list",
  174. "name": "chat-log-list",
  175. "component": "/account/chatLogList/index",
  176. "meta": Map{
  177. "title": "聊天记录",
  178. },
  179. },*/
  180. },
  181. })
  182. if config.IsSuperRole(service.User.GetUserRoleId(c)) {
  183. // 权限管理
  184. lists = append(lists, Map{
  185. "id": 3,
  186. "path": "/permission",
  187. "name": "Permission",
  188. "component": "LAYOUT",
  189. "redirect": "/permission/menu",
  190. "meta": Map{
  191. "icon": "SafetyCertificateOutlined",
  192. "title": "权限管理",
  193. "sort": 1,
  194. },
  195. "children": []Map{
  196. {
  197. "id": 3003,
  198. "path": "menu",
  199. "name": "permission_menu",
  200. "component": "/permission/menu/menu",
  201. "meta": Map{
  202. "title": "菜单权限",
  203. },
  204. },
  205. {
  206. "id": 3001,
  207. "path": "user",
  208. "name": "permission_user",
  209. "component": "/permission/user/user",
  210. "meta": Map{
  211. "title": "后台用户",
  212. },
  213. },
  214. {
  215. "id": 3002,
  216. "path": "role",
  217. "name": "permission_role",
  218. "component": "/permission/role/role",
  219. "meta": Map{
  220. "title": "角色管理",
  221. },
  222. },
  223. },
  224. })
  225. }
  226. // 充值管理
  227. /*lists = append(lists, Map{
  228. "id": 4,
  229. "path": "/recharge",
  230. "name": "Recharge",
  231. "component": "LAYOUT",
  232. "redirect": "/recharge/recharge-list",
  233. "meta": Map{
  234. "icon": "PayCircleOutlined",
  235. "title": "充值订单",
  236. "sort": 2,
  237. },
  238. "children": []Map{
  239. {
  240. "id": 4001,
  241. "path": "recharge-list",
  242. "name": "recharge-list",
  243. "component": "/recharge/rechargeList/index",
  244. "meta": Map{
  245. "title": "订单记录",
  246. },
  247. },
  248. {
  249. "id": 4002,
  250. "path": "recharge-dailyStatistics",
  251. "name": "recharge-dailyStatistics",
  252. "component": "/recharge/dailyStatistics/index",
  253. "meta": Map{
  254. "title": "每日统计",
  255. },
  256. },
  257. {
  258. "id": 4003,
  259. "path": "recharge-ordersSettle",
  260. "name": "recharge-ordersSettle",
  261. "component": "/recharge/ordersSettle/index",
  262. "meta": Map{
  263. "title": "余额平账",
  264. "keepAlive": true,
  265. },
  266. },
  267. {
  268. "id": 4004,
  269. "path": "recharge-abnormalOrder",
  270. "name": "recharge-abnormalOrder",
  271. "component": "/recharge/abnormalOrder/index",
  272. "meta": Map{
  273. "title": "异常订单",
  274. "keepAlive": true,
  275. },
  276. },
  277. },
  278. })*/
  279. // 排行榜
  280. /*lists = append(lists, Map{
  281. "id": 5,
  282. "path": "/ranking",
  283. "name": "Ranking",
  284. "component": "LAYOUT",
  285. "redirect": "/ranking/index",
  286. "meta": Map{
  287. "icon": "CellularOutline",
  288. "title": "排行榜",
  289. "sort": 2,
  290. },
  291. "children": []Map{
  292. {
  293. "id": 5001,
  294. "path": "recharge-ranking",
  295. "name": "recharge-ranking",
  296. "component": "/ranking/recharge/index",
  297. "meta": Map{
  298. "title": "充值排行",
  299. },
  300. },
  301. {
  302. "id": 5002,
  303. "path": "diamond-ranking",
  304. "name": "diamond-ranking",
  305. "component": "/ranking/diamond/index",
  306. "meta": Map{
  307. "title": "消费排行",
  308. },
  309. },
  310. {
  311. "id": 5003,
  312. "path": "level-ranking",
  313. "name": "level-ranking",
  314. "component": "/ranking/level/index",
  315. "meta": Map{
  316. "title": "等级排行",
  317. },
  318. },
  319. {
  320. "id": 5004,
  321. "path": "elrank-ranking",
  322. "name": "elrank-ranking",
  323. "component": "/ranking/elrank/index",
  324. "meta": Map{
  325. "title": "无尽排行",
  326. },
  327. },
  328. {
  329. "id": 5005,
  330. "path": "duel-ranking",
  331. "name": "duel-ranking",
  332. "component": "/ranking/duel/index",
  333. "meta": Map{
  334. "title": "狭路排行",
  335. },
  336. },
  337. {
  338. "id": 5006,
  339. "path": "gudong-ranking",
  340. "name": "gudong-ranking",
  341. "component": "/ranking/gudong/index",
  342. "meta": Map{
  343. "title": "古玩排行",
  344. },
  345. },
  346. {
  347. "id": 5007,
  348. "path": "idiom-ranking",
  349. "name": "idiom-ranking",
  350. "component": "/ranking/idiom/index",
  351. "meta": Map{
  352. "title": "金榜题名",
  353. },
  354. },
  355. {
  356. "id": 5008,
  357. "path": "boss-ranking",
  358. "name": "boss-ranking",
  359. "component": "/ranking/boss/index",
  360. "meta": Map{
  361. "title": "暗影突袭",
  362. },
  363. },
  364. {
  365. "id": 5009,
  366. "path": "adv-ranking",
  367. "name": "adv-ranking",
  368. "component": "/ranking/adv/index",
  369. "meta": Map{
  370. "title": "看广告排行",
  371. },
  372. },
  373. {
  374. "id": 5010,
  375. "path": "login-ranking",
  376. "name": "login-ranking",
  377. "component": "/ranking/login/index",
  378. "meta": Map{
  379. "title": "登录排行",
  380. },
  381. },
  382. },
  383. })*/
  384. // 数据统计
  385. /*lists = append(lists, Map{
  386. "id": 6,
  387. "path": "/echarts",
  388. "name": "Echarts",
  389. "component": "LAYOUT",
  390. "redirect": "/echarts/index",
  391. "meta": Map{
  392. "icon": "BarChartOutline",
  393. "title": "数据统计",
  394. "sort": 2,
  395. },
  396. "children": []Map{
  397. {
  398. "id": 6001,
  399. "path": "login-echarts",
  400. "name": "login-echarts",
  401. "component": "/echarts/login/index",
  402. "meta": Map{
  403. "title": "登录数据",
  404. },
  405. },
  406. {
  407. "id": 6002,
  408. "path": "chapter-echarts",
  409. "name": "chapter-echarts",
  410. "component": "/echarts/chapter/index",
  411. "meta": Map{
  412. "title": "关卡数据",
  413. },
  414. },
  415. {
  416. "id": 6003,
  417. "path": "basic-echarts",
  418. "name": "basic-echarts",
  419. "component": "/echarts/basic/index",
  420. "meta": Map{
  421. "title": "基础数据",
  422. },
  423. },
  424. {
  425. "id": 6004,
  426. "path": "adv-echarts",
  427. "name": "adv-echarts",
  428. "component": "/echarts/adv/index",
  429. "meta": Map{
  430. "title": "广告数据",
  431. },
  432. },
  433. {
  434. "id": 6005,
  435. "path": "echarts-tests",
  436. "name": "echarts-tests",
  437. "component": "/echarts/adv/index2",
  438. "meta": Map{
  439. "hidden": localHidden,
  440. "title": "图表测试",
  441. },
  442. },
  443. {
  444. "id": 6006,
  445. "path": "goods-echarts",
  446. "name": "goods-echarts",
  447. "component": "/echarts/goods/index",
  448. "meta": Map{
  449. "title": "商品数据",
  450. },
  451. },
  452. {
  453. "id": 6007,
  454. "path": "gudong-echarts",
  455. "name": "gudong-echarts",
  456. "component": "/echarts/gudong/index",
  457. "meta": Map{
  458. "title": "古玩数据",
  459. },
  460. },
  461. {
  462. "id": 6008,
  463. "path": "duel-echarts",
  464. "name": "duel-echarts",
  465. "component": "/echarts/duel/index",
  466. "meta": Map{
  467. "title": "狭路对决",
  468. },
  469. },
  470. {
  471. "id": 6009,
  472. "path": "expedition-echarts",
  473. "name": "expedition-echarts",
  474. "component": "/echarts/expedition/index",
  475. "meta": Map{
  476. "title": "远征数据",
  477. },
  478. },
  479. {
  480. "id": 6010,
  481. "path": "idiom-echarts",
  482. "name": "idiom-echarts",
  483. "component": "/echarts/idiom/index",
  484. "meta": Map{
  485. "title": "金榜题名",
  486. },
  487. },
  488. {
  489. "id": 6011,
  490. "path": "boss-echarts",
  491. "name": "boss-echarts",
  492. "component": "/echarts/boss/index",
  493. "meta": Map{
  494. "title": "暗影突袭",
  495. },
  496. },
  497. {
  498. "id": 6012,
  499. "path": "seven-echarts",
  500. "name": "seven-echarts",
  501. "component": "/echarts/seven/index",
  502. "meta": Map{
  503. "title": "七日任务",
  504. },
  505. },
  506. {
  507. "id": 6013,
  508. "path": "disconnect-echarts",
  509. "name": "disconnect-echarts",
  510. "component": "/echarts/disconnect/index",
  511. "meta": Map{
  512. "title": "重连数据",
  513. },
  514. },
  515. {
  516. "id": 6014,
  517. "path": "gem-echarts",
  518. "name": "gem-echarts",
  519. "component": "/echarts/gem/index",
  520. "meta": Map{
  521. "title": "宝石数据",
  522. },
  523. },
  524. {
  525. "id": 6015,
  526. "path": "limitgift-echarts",
  527. "name": "limitgift-echarts",
  528. "component": "/echarts/limitgift/index",
  529. "meta": Map{
  530. "title": "限时礼包",
  531. },
  532. },
  533. {
  534. "id": 6016,
  535. "path": "treasure-echarts",
  536. "name": "treasure-echarts",
  537. "component": "/echarts/treasure/index",
  538. "meta": Map{
  539. "title": "宝物数据",
  540. },
  541. },
  542. {
  543. "id": 6017,
  544. "path": "grandmaster-echarts",
  545. "name": "grandmaster-echarts",
  546. "component": "/echarts/grandmaster/index",
  547. "meta": Map{
  548. "title": "最强王者",
  549. },
  550. },
  551. {
  552. "id": 6018,
  553. "path": "gradeDistribution-echarts",
  554. "name": "gradeDistribution-echarts",
  555. "component": "/echarts/gradeDistribution/index",
  556. "meta": Map{
  557. "title": "玩家等级分布",
  558. },
  559. },
  560. {
  561. "id": 6019,
  562. "path": "roles-echarts",
  563. "name": "roles-echarts",
  564. "component": "/echarts/roles/index",
  565. "meta": Map{
  566. "title": "玩家拥有角色",
  567. },
  568. },
  569. {
  570. "id": 6020,
  571. "path": "heroLevelDistribution-echarts",
  572. "name": "heroLevelDistribution-echarts",
  573. "component": "/echarts/heroLevelDistribution/index",
  574. "meta": Map{
  575. "title": "角色等级分布",
  576. },
  577. },
  578. {
  579. "id": 6021,
  580. "path": "levelOutput-echarts",
  581. "name": "levelOutput-echarts",
  582. "component": "/echarts/levelOutput/index",
  583. "meta": Map{
  584. "title": "玩家等级产出",
  585. },
  586. },
  587. },
  588. })*/
  589. gameToolMap := make([]Map, 0)
  590. gameToolMap = append(gameToolMap, Map{
  591. "id": 7001,
  592. "path": "config",
  593. "name": "system_config",
  594. "component": "/system/config/config",
  595. "meta": Map{
  596. "title": "服务配置",
  597. },
  598. }, Map{
  599. "id": 7002,
  600. "path": "deploy",
  601. "name": "system_deploy",
  602. "component": "/deploy/index",
  603. "meta": Map{
  604. "title": "服务部署",
  605. },
  606. })
  607. //// 非正式环境加载工具库
  608. //if os.Getenv("GIN_MODE") != "release" && os.Getenv("GIN_MODE") != "" {
  609. // gameToolMap = append(gameToolMap, Map{
  610. // "path": "reboot",
  611. // "name": "system_reboot",
  612. // "component": "/system/reboot/index",
  613. // "meta": Map{
  614. // "title": "重启服务",
  615. // }})
  616. //}
  617. /*gameToolMap = append(gameToolMap, Map{
  618. "path": "activity-tool",
  619. "name": "activity-tool",
  620. "component": "/tool/activity/index",
  621. "meta": Map{
  622. "title": "活动查询",
  623. },
  624. })*/
  625. // 游戏工具
  626. lists = append(lists, Map{
  627. "id": 7,
  628. "path": "/tool",
  629. "name": "Tool",
  630. "component": "LAYOUT",
  631. "redirect": "/tool/index",
  632. "meta": Map{
  633. "icon": "ToolOutlined",
  634. "title": "游戏工具",
  635. "sort": 5,
  636. },
  637. "children": gameToolMap,
  638. })
  639. // 邮件通知
  640. /*lists = append(lists, Map{
  641. "id": 8,
  642. "path": "/email",
  643. "name": "email",
  644. "component": "LAYOUT",
  645. //"redirect": "/frame/docs",
  646. "meta": Map{
  647. "icon": "MailOutlined",
  648. "sort": 10,
  649. "isRoot": true,
  650. "activeMenu": "email_index",
  651. },
  652. "children": []Map{
  653. {
  654. "id": 8001,
  655. "path": "index",
  656. "name": "email_index",
  657. "component": "/email/index",
  658. "meta": Map{
  659. "title": "邮件通知",
  660. "activeMenu": "email_index",
  661. },
  662. }},
  663. })*/
  664. // 邮件通知
  665. /*lists = append(lists, Map{
  666. "id": 9,
  667. "path": "/Mail",
  668. "name": "mail",
  669. "component": "LAYOUT",
  670. //"redirect": "/frame/docs",
  671. "meta": Map{
  672. "icon": "MailOutlined",
  673. "sort": 10,
  674. "isRoot": true,
  675. "activeMenu": "mail_index",
  676. },
  677. "children": []Map{
  678. {
  679. "id": 9001,
  680. "path": "index",
  681. "name": "mail_index",
  682. "component": "/mail/index",
  683. "meta": Map{
  684. "title": "邮件通知(旧)",
  685. "activeMenu": "mail_index",
  686. },
  687. }},
  688. })*/
  689. // 广播通知
  690. /*lists = append(lists, Map{
  691. "id": 10,
  692. "path": "/notice",
  693. "name": "notice",
  694. "component": "LAYOUT",
  695. //"redirect": "/frame/docs",
  696. "meta": Map{
  697. "icon": "MegaphoneOutline",
  698. "sort": 10,
  699. "title": "广播管理",
  700. //"isRoot": true,
  701. //"activeMenu": "noticev2_index",
  702. },
  703. "children": []Map{
  704. {
  705. "id": 10001,
  706. "path": "noticev2_index", // ?
  707. "name": "noticev2_index",
  708. "component": "/noticev2/index",
  709. "meta": Map{
  710. "title": "广播通知",
  711. //"activeMenu": "noticev2_index",
  712. },
  713. },
  714. //{
  715. // "path": "index",
  716. // "name": "notice_index",
  717. // "component": "/notice/index",
  718. // "meta": Map{
  719. // "title": "广播通知(旧)",
  720. // //"activeMenu": "notice_index",
  721. // },
  722. //},
  723. },
  724. })*/
  725. // 客服记录
  726. /*lists = append(lists, Map{
  727. "id": 11,
  728. "path": "/chatLog",
  729. "name": "ChatLog",
  730. "component": "LAYOUT",
  731. "meta": Map{
  732. "icon": "ChatboxEllipsesOutline",
  733. "sort": 10,
  734. "title": "客服记录",
  735. "permissions": "ChatLog",
  736. },
  737. "children": []Map{
  738. {
  739. "id": 11001,
  740. "path": "chatLog-index",
  741. "name": "chatLog-index",
  742. "component": "/chatLog/index",
  743. "meta": Map{
  744. "title": "客服记录",
  745. },
  746. },
  747. },
  748. })*/
  749. // 兑换码
  750. /*lists = append(lists, Map{
  751. "id": 12,
  752. "path": "/cdk",
  753. "name": "cdk",
  754. "component": "LAYOUT",
  755. //"redirect": "/frame/docs",
  756. "meta": Map{
  757. "icon": "TicketOutline",
  758. "sort": 10,
  759. //"isRoot": true,
  760. //"activeMenu": "cdk_index",
  761. "title": "兑换码管理",
  762. },
  763. "children": []Map{
  764. {
  765. "id": 12001,
  766. "path": "index",
  767. "name": "cdk_index",
  768. "component": "/cdk/index",
  769. "meta": Map{
  770. "title": "批次列表",
  771. "activeMenu": "cdk_index",
  772. },
  773. },
  774. {
  775. "id": 12002,
  776. "path": "cdk-redeemCodeList/:sn?",
  777. "name": "cdk-redeemCodeList",
  778. "component": "/cdk/redeemCodeList",
  779. "meta": Map{
  780. "title": "兑换码列表",
  781. //"hidden": true,
  782. //"activeMenu": "cdk_index",
  783. },
  784. },
  785. },
  786. })*/
  787. // 设置页面
  788. lists = append(lists, Map{
  789. "id": 13,
  790. "path": "/setting",
  791. "name": "Setting",
  792. "component": "LAYOUT",
  793. "redirect": "/setting/account",
  794. "meta": Map{
  795. "icon": "SettingOutlined",
  796. "title": "账户设置",
  797. "sort": 20,
  798. },
  799. "hidden": false,
  800. "children": []Map{
  801. {
  802. "id": 13001,
  803. "path": "account",
  804. "name": "setting-account",
  805. "component": "/setting/account/account",
  806. "meta": Map{
  807. "title": "个人信息",
  808. },
  809. },
  810. //{
  811. // "path": "info",
  812. // "name": "result-info",
  813. // "component": "/setting/system/system",
  814. // "meta": Map{
  815. // "title": "信息页",
  816. // },
  817. //},
  818. {
  819. "id": 13002,
  820. "path": "log",
  821. "name": "log-index",
  822. "component": "/log/index",
  823. "meta": Map{
  824. "title": "操作日志",
  825. },
  826. },
  827. {
  828. "id": 13003,
  829. "path": "log-view/:id?",
  830. "name": "log-view",
  831. "component": "/log/view",
  832. "meta": Map{
  833. "title": "日志详情",
  834. "hidden": true,
  835. "activeMenu": "log-index",
  836. },
  837. },
  838. },
  839. })
  840. t := c.GetHeader("authorization")
  841. // 管理后台切换
  842. lists = append(lists, Map{
  843. "id": 14,
  844. "path": "/server_select",
  845. "name": "ServerSelect",
  846. "component": "LAYOUT",
  847. "meta": Map{
  848. "icon": "ServerOutline",
  849. "title": "管理后台切换",
  850. "sort": 5,
  851. },
  852. "children": []Map{
  853. {
  854. "id": 14001,
  855. "path": "/redirect",
  856. "name": "http://101.43.249.6:7004/gadmin/?access-token=%s" + t,
  857. "component": "LAYOUT",
  858. "meta": Map{
  859. "title": "魔君测试服",
  860. },
  861. },
  862. {
  863. "id": 14002,
  864. "path": "/redirect",
  865. "name": "http://101.43.249.6:7006/cadmin/?access-token=" + t,
  866. "component": "LAYOUT",
  867. "meta": Map{
  868. "title": "空之契约测试服",
  869. },
  870. },
  871. {
  872. "id": 14003,
  873. "path": "/redirect",
  874. "name": "http://192.168.0.186:8253/gadmin/?access-token=" + t,
  875. "component": "LAYOUT",
  876. "meta": Map{
  877. "title": "魔君本地",
  878. },
  879. },
  880. },
  881. })
  882. // 文档
  883. if localHidden == false {
  884. lists = append(lists, Map{
  885. "id": 15,
  886. "path": "/external",
  887. "name": "https://www.naiveui.com",
  888. "component": "LAYOUT",
  889. "meta": Map{
  890. "icon": "DocumentTextOutline",
  891. "title": "NaiveUi文档",
  892. "sort": 99,
  893. },
  894. "children": []Map{},
  895. })
  896. }
  897. return lists
  898. }