permission.js 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768
  1. import {
  2. asyncRoutes,
  3. constantRoutes
  4. } from '@/router'
  5. import router from '@/router'
  6. import {
  7. getSilder
  8. } from '@/api/silder'
  9. import store from "@/store";
  10. import {
  11. Message
  12. } from 'element-ui'
  13. // import { stat } from 'fs'
  14. // import { removeToken } from '@/utils/auth'
  15. // import Layout from '@/layout'
  16. /**
  17. * 遍历接口菜单添加页面
  18. * @param asyncRoutes
  19. * @param getMenu
  20. */
  21. function generateAsyncRouter(asyncRoutes, data) {
  22. if (!data) {
  23. return []
  24. }
  25. data.forEach((item) => {
  26. item.component = asyncRoutes[item.component]
  27. if (item.children && item.children.length > 0) {
  28. generateAsyncRouter(asyncRoutes, item.children)
  29. }
  30. })
  31. return data
  32. }
  33. /**
  34. * 判断平台端添加首页
  35. * @param type
  36. */
  37. // const type = getters.type
  38. const state = {
  39. routes: [],
  40. addRoutes: [],
  41. type: '', // 登录的平台类型
  42. permission: [] // 权限
  43. }
  44. const mutations = {
  45. SET_ROUTES: (state, routes) => {
  46. state.addRoutes = routes
  47. state.routes = constantRoutes.concat(routes)
  48. },
  49. SET_PERMISSION: (state, permission) => {
  50. state.permission = permission
  51. }
  52. }
  53. function getFirstMenu(routes) {
  54. let firstMenu = null
  55. routes.forEach(item => {
  56. if (item.children?.length > 0 && !item.hidden) {
  57. firstMenu = pathErgodic(item)
  58. // console.log(firstMenu)
  59. item.redirect = firstMenu
  60. }
  61. })
  62. return routes
  63. }
  64. function pathErgodic(item) {
  65. // console.log(item)
  66. let firstMenu = null
  67. item.children.forEach(i => {
  68. if (!firstMenu && i.children?.length > 0 && !i.hidden) {
  69. let isChildrenList = false;
  70. i.children.forEach(ii => {
  71. if (!ii.hidden) {
  72. isChildrenList = true
  73. }
  74. })
  75. if (isChildrenList) {
  76. firstMenu = pathErgodic(i)
  77. } else {
  78. if (!firstMenu && checkPathUrl(i.path)) {
  79. firstMenu = i.path
  80. } else {
  81. if (!firstMenu && !i.hidden) {
  82. firstMenu = item.path + '/' + i.path
  83. }
  84. }
  85. }
  86. } else {
  87. if (!firstMenu && checkPathUrl(i.path)) {
  88. firstMenu = i.path
  89. } else {
  90. if (!firstMenu && !i.hidden) {
  91. firstMenu = item.path + '/' + i.path
  92. }
  93. }
  94. }
  95. })
  96. return firstMenu
  97. }
  98. // 判断path有没有带/,并且是第一个位置
  99. function checkPathUrl(path) {
  100. return path.indexOf('/') === 0 ? true : false
  101. }
  102. // 路由
  103. // 递归遍历数组
  104. function recursionRouter(arr) {
  105. // 这里来了
  106. if (arr.length > 0) {
  107. let newArr = [];
  108. for (let i = 0; i < arr.length; i++) {
  109. if (arr[i].type == 1) {
  110. continue
  111. }
  112. let obj = {};
  113. obj.component = arr[i].component;
  114. obj.name = arr[i].component;
  115. // if (item.type != '1' && item.component) {
  116. // if (!item.path.startsWith('/') && item.component != 'Layout') {
  117. // obj.names = item.name
  118. // }
  119. // }
  120. arr[i].hid == 0 ? obj.hidden = false : obj.hidden = true
  121. // console.log('高亮标签'+arr[i].parentPermission,'普通路径'+arr[i].path)
  122. obj.path = arr[i].path;
  123. obj.meta = {
  124. 'title': arr[i].name,
  125. 'icon': arr[i].icon,
  126. 'noCache': arr[i].keepAlive,
  127. 'activeMenu': arr[i].parentPermission,
  128. 'belongTopMenu': arr[i].belongTopMenu,
  129. 'id': arr[i].id
  130. }
  131. if (arr[i].sysMenus && arr[i].sysMenus.length > 0) {
  132. obj.children = recursionRouter(arr[i].sysMenus);
  133. }
  134. newArr.push(obj)
  135. }
  136. return newArr
  137. }
  138. }
  139. // 设置 belongTopMenu, 顶部菜单
  140. function addTopMenu(arr) {
  141. if (arr.length > 0) {
  142. let newArr = [];
  143. for (let i = 0; i < arr.length; i++) {
  144. if (arr[i].type == 1) {
  145. continue
  146. }
  147. let obj = arr[i]
  148. obj.belongTopMenu = obj.path
  149. if (arr[i].sysMenus && arr[i].sysMenus.length > 0) {
  150. obj.sysMenus = setTopMenu(arr[i].sysMenus, obj);
  151. }
  152. newArr.push(obj)
  153. }
  154. return newArr
  155. }
  156. }
  157. function setTopMenu(arr, topParentArr) {
  158. let newArr = [];
  159. for (let i = 0; i < arr.length; i++) {
  160. let obj = arr[i]
  161. obj.belongTopMenu = topParentArr.path
  162. if (arr[i].sysMenus && arr[i].sysMenus.length > 0) {
  163. obj.sysMenus = setTopMenu(arr[i].sysMenus, topParentArr);
  164. }
  165. newArr.push(obj)
  166. }
  167. return newArr
  168. }
  169. // 权限
  170. // 递归遍历数组
  171. let tempArr = []
  172. function recursionPermission(arr) {
  173. arr.map(item => {
  174. tempArr.push(item.memo)
  175. if (item.sysMenus && item.sysMenus.length > 0) {
  176. recursionPermission(item.sysMenus)
  177. }
  178. })
  179. }
  180. function setDetailRoute(accessedRoutes) {
  181. // console.log(accessedRoutes)
  182. accessedRoutes.forEach(route => {
  183. // console.log(route.path)
  184. if (route.path == '/main') {
  185. route.children = route.children.concat([{
  186. name: '日程安排',
  187. path: 'scheduleDetail',
  188. component: () => import('@/views/main/teamSchedule/scheduleDetail'),
  189. hidden: true,
  190. meta: {
  191. noCache: '1',
  192. title: '日程安排',
  193. belongTopMenu: "/main",
  194. activeMenu: '/main/main',
  195. id: 'xx1'
  196. }
  197. },
  198. {
  199. name: '未在班级学员',
  200. path: 'notClassStudent',
  201. component: () => import('@/views/main/notClassStudent'),
  202. hidden: true,
  203. meta: {
  204. noCache: '1',
  205. title: '未在班级学员',
  206. belongTopMenu: "/main",
  207. activeMenu: '/main/main',
  208. id: 'xx2'
  209. }
  210. },
  211. {
  212. name: '学员请假列表',
  213. path: 'studentLeaveList',
  214. component: () => import('@/views/main/studentLeaveList'),
  215. hidden: true,
  216. meta: {
  217. noCache: '1',
  218. title: '学员请假列表',
  219. belongTopMenu: "/main",
  220. activeMenu: '/main/main'
  221. }
  222. },
  223. {
  224. name: '乐团会员列表',
  225. path: 'teamMemberList',
  226. component: () => import('@/views/studentManager/memberList'),
  227. hidden: true,
  228. meta: {
  229. noCache: '1',
  230. title: '乐团会员列表',
  231. belongTopMenu: "/main",
  232. activeMenu: '/main/main'
  233. }
  234. },
  235. {
  236. name: '乐团展演列表',
  237. path: 'teamShowList',
  238. component: () => import('@/views/main/teamShowList'),
  239. hidden: true,
  240. meta: {
  241. noCache: '1',
  242. title: '乐团展演列表',
  243. belongTopMenu: "/main",
  244. activeMenu: '/main/main'
  245. }
  246. },
  247. {
  248. name: 'organDateDetail',
  249. path: 'organDateDetail',
  250. component: () => import('@/views/main/cloudDate/organDateDetail'),
  251. hidden: true,
  252. meta: {
  253. noCache: '1',
  254. title: '分部云教练数据详情',
  255. belongTopMenu: "/main",
  256. activeMenu: '/main/main'
  257. }
  258. },
  259. {
  260. name: 'organRankDetail',
  261. path: 'organRankDetail',
  262. component: () => import('@/views/main/cloudDate/organRankDetail'),
  263. hidden: true,
  264. meta: {
  265. noCache: '1',
  266. title: '分部云教练排行',
  267. belongTopMenu: "/main",
  268. activeMenu: '/main/main'
  269. }
  270. },
  271. //
  272. ])
  273. }
  274. if (route.path == '/business') {
  275. // import('@/views/resetTeaming/components/strudentPayInfo'),
  276. route.children = route.children.concat([{
  277. name: '学员缴费详情',
  278. path: 'strudentPayInfo',
  279. component: () => import('@/views/resetTeaming/components/strudentPayInfo'),
  280. hidden: true,
  281. meta: {
  282. noCache: '1',
  283. title: '学员缴费详情',
  284. belongTopMenu: "/business",
  285. activeMenu: '/teamList',
  286. id: 'xx3'
  287. }
  288. },
  289. {
  290. name: '乐团详情',
  291. path: 'resetTeaming',
  292. component: () => import('@/views/resetTeaming/index'),
  293. hidden: true,
  294. meta: {
  295. noCache: '1',
  296. title: '乐团详情',
  297. belongTopMenu: "/business",
  298. activeMenu: '/teamList',
  299. id: 'xx4'
  300. }
  301. },
  302. {
  303. name: '乐团档案',
  304. path: 'musicArchices',
  305. component: () => import('@/views/resetTeaming/components/musicArchices'),
  306. hidden: true,
  307. meta: {
  308. noCache: '1',
  309. title: '乐团档案',
  310. belongTopMenu: "/business",
  311. activeMenu: '/teamList',
  312. id: 'xx4'
  313. }
  314. },
  315. //musicArchices
  316. {
  317. name: '会员排课列表',
  318. path: 'memberClassList',
  319. component: () => import('@/views/teamDetail/components/memberClassList'),
  320. hidden: true,
  321. meta: {
  322. noCache: '1',
  323. title: '会员排课列表',
  324. belongTopMenu: "/business",
  325. activeMenu: '/teamList',
  326. id: 'xx28'
  327. }
  328. },
  329. {
  330. name: '相册详情',
  331. path: 'photo-detail',
  332. component: () => import('@/views/photo-detail'),
  333. hidden: true,
  334. meta: {
  335. noCache: '1',
  336. title: '相册详情',
  337. belongTopMenu: "/business",
  338. activeMenu: '/teamList',
  339. id: 'xxx28'
  340. }
  341. },
  342. // 相册详情
  343. {
  344. name: '全部证书',
  345. path: 'performance',
  346. component: () => import('@/views/photo-detail'),
  347. hidden: true,
  348. meta: {
  349. noCache: '1',
  350. title: '全部证书',
  351. belongTopMenu: "/business",
  352. activeMenu: '/teamList',
  353. id: 'xxx28'
  354. }
  355. },
  356. // 全部证书
  357. {
  358. name: '新建vip',
  359. path: 'buildVip',
  360. component: () => import('@/views/buildVip/index'),
  361. hidden: true,
  362. meta: {
  363. noCache: '1',
  364. title: 'VIP/乐理课申请',
  365. belongTopMenu: "/business",
  366. activeMenu: '/vipManager/vipList',
  367. id: 'xx5'
  368. }
  369. },
  370. {
  371. name: 'vip修改',
  372. path: 'vipReset',
  373. component: () => import('@/views/vipClass/vipReset'),
  374. hidden: true,
  375. meta: {
  376. noCache: '1',
  377. title: 'VIP/乐理课修改',
  378. belongTopMenu: "/business",
  379. activeMenu: '/vipManager/vipList',
  380. id: 'xx6'
  381. }
  382. },
  383. {
  384. name: 'vip详情',
  385. path: 'vipDetail',
  386. component: () => import('@/views/vipClass/vipDetail'),
  387. hidden: true,
  388. meta: {
  389. noCache: '1',
  390. title: 'vip详情',
  391. belongTopMenu: "/business",
  392. activeMenu: '/vipManager/vipList',
  393. id: 'xx7'
  394. }
  395. },
  396. {
  397. name: '网管课详情',
  398. path: 'accompanys',
  399. component: () => import('@/views/accompanyManager/accompanys'),
  400. hidden: true,
  401. meta: {
  402. noCache: '1',
  403. title: '网管课详情',
  404. belongTopMenu: "/business",
  405. activeMenu: '/accompanyManager/accompany',
  406. id: 'xx8'
  407. }
  408. },
  409. {
  410. name: '评价详情',
  411. path: 'evaluateDetail',
  412. component: () => import('@/views/evaluateManager/evaluateDetail'),
  413. hidden: true,
  414. meta: {
  415. noCache: '1',
  416. title: '评价详情',
  417. belongTopMenu: "/business",
  418. activeMenu: '/commentManager',
  419. id: 'xx9'
  420. }
  421. },
  422. {
  423. name: '课外训练详情',
  424. path: 'afterSchoolDetail',
  425. component: () => import('@/views/afterSchoolManager/afterSchoolDetail'),
  426. hidden: true,
  427. meta: {
  428. noCache: '1',
  429. title: 'VIP/乐理课详情',
  430. belongTopMenu: "/business",
  431. activeMenu: '/afterSchoolManager',
  432. id: 'xx10'
  433. }
  434. },
  435. {
  436. name: '学员详情',
  437. path: 'studentDetail',
  438. component: () => import('@/views/studentManager/index'),
  439. hidden: true,
  440. meta: {
  441. noCache: '1',
  442. title: '学员详情',
  443. belongTopMenu: "/business",
  444. activeMenu: '/studentManager/studentList',
  445. id: 'xx11'
  446. }
  447. },
  448. {
  449. name: '老师详情',
  450. path: 'teacherDetail',
  451. component: () => import('@/views/teacherManager/teacherDetail/index'),
  452. hidden: true,
  453. meta: {
  454. noCache: '1',
  455. title: '老师详情',
  456. belongTopMenu: "/business",
  457. activeMenu: '/teacherManager/teacherList',
  458. id: 'xx12'
  459. }
  460. },
  461. {
  462. name: '老师修改',
  463. path: 'teacherOperation',
  464. component: () => import('@/views/teacherManager/teacherOperation/index'),
  465. hidden: true,
  466. meta: {
  467. noCache: '1',
  468. title: '老师修改',
  469. belongTopMenu: "/business",
  470. activeMenu: '/teacherManager/teacherList',
  471. id: 'xx13'
  472. }
  473. },
  474. {
  475. name: '问答详情',
  476. path: 'answer',
  477. component: () => import('@/views/reaplceMusicPlayer/answerList'),
  478. hidden: true,
  479. meta: {
  480. noCache: '1',
  481. title: '问答详情',
  482. belongTopMenu: "/business",
  483. activeMenu: '/otherManager/reaplceMusicPlayer',
  484. id: 'xx4'
  485. }
  486. },
  487. {
  488. name: '活动详情',
  489. path: 'childrensdayDetail',
  490. component: () => import('@/views/childrensDay/detail'),
  491. hidden: true,
  492. meta: {
  493. noCache: '1',
  494. title: '活动详情',
  495. belongTopMenu: "/business",
  496. activeMenu: '/childrensDay'
  497. }
  498. },
  499. // /otherManager/reaplceMusicPlayer /reaplceMusicPlayer/answer
  500. ])
  501. }
  502. if (route.path == '/operateManager') {
  503. route.children = route.children.concat([{
  504. name: '服务指标(详情)',
  505. path: 'serverIndexDetail',
  506. component: () => import('@/views/operateManager/serverIndexDetail'),
  507. hidden: true,
  508. meta: {
  509. noCache: '1',
  510. title: '服务指标(详情)',
  511. belongTopMenu: "/operateManager",
  512. activeMenu: '/serverIndexManager/serverIndexList',
  513. id: 'xx15'
  514. }
  515. },
  516. {
  517. name: '新建活动方案',
  518. path: 'vipNewActive',
  519. component: () => import('@/views/categroyManager/vipNewActive'),
  520. hidden: true,
  521. meta: {
  522. noCache: '1',
  523. title: '新建活动方案',
  524. belongTopMenu: "/operateManager",
  525. activeMenu: '/vipActiveManager/vipActiveList',
  526. id: 'xx16'
  527. }
  528. },
  529. {
  530. name: '添加分部活动',
  531. path: 'branchActiveOperationAdd',
  532. component: () => import('@/views/categroyManager/insideSetting/branchActiveOperation'),
  533. hidden: true,
  534. meta: {
  535. noCache: '1',
  536. title: '添加分部活动',
  537. belongTopMenu: "/operateManager",
  538. activeMenu: '/branchActiveManager/branchActive',
  539. id: 'xx17'
  540. }
  541. },
  542. {
  543. name: '修改分部活动',
  544. path: 'branchActiveOperation',
  545. component: () => import('@/views/categroyManager/insideSetting/branchActiveOperation'),
  546. hidden: true,
  547. meta: {
  548. noCache: '1',
  549. title: '修改分部活动',
  550. belongTopMenu: "/operateManager",
  551. activeMenu: '/branchActiveManager/branchActive',
  552. id: 'xx18'
  553. }
  554. },
  555. {
  556. name: '添加问卷',
  557. path: 'questionOperations',
  558. component: () => import('@/views/setQuestions/operation'),
  559. hidden: true,
  560. meta: {
  561. noCache: '1',
  562. title: '添加问卷',
  563. belongTopMenu: "/operateManager",
  564. activeMenu: '/operateManager/setQuestions',
  565. id: 'xx19'
  566. }
  567. },
  568. // /operateManager/setQuestions /questionOperation operateManager
  569. ])
  570. }
  571. if (route.path == '/financialManager') {
  572. route.children = route.children.concat([{
  573. name: '经营报表详情',
  574. path: 'businessStatementDetail',
  575. component: () => import('@/views/businessManager/orderManager/businessStatementDetail'),
  576. hidden: true,
  577. meta: {
  578. noCache: '1',
  579. title: '经营报表详情',
  580. belongTopMenu: "/financialManager",
  581. activeMenu: '/businessStatement',
  582. id: 'xx20'
  583. }
  584. }, ])
  585. }
  586. if (route.path == '/contentManager') {
  587. route.children = route.children.concat([{
  588. name: '经营报表详情',
  589. path: 'helpCategory',
  590. component: () => import('@/views/helpCenter/helpCategory'),
  591. hidden: true,
  592. meta: {
  593. noCache: '1',
  594. title: '经营报表详情',
  595. belongTopMenu: "/contentManager",
  596. activeMenu: '/contentManager/helpContent',
  597. id: 'xx21'
  598. }
  599. },
  600. {
  601. name: '添加&修改内容管理',
  602. path: 'contentOperation',
  603. component: () => import('@/views/contentManager/contentOperation'),
  604. hidden: true,
  605. meta: {
  606. noCache: '1',
  607. title: '添加&修改内容管理',
  608. belongTopMenu: "/contentManager",
  609. activeMenu: '/contentManager/contentManager',
  610. id: 'xx22'
  611. }
  612. },
  613. ])
  614. }
  615. if (route.path == '/shopManager') {
  616. route.children = route.children.concat([{
  617. name: '进货清单',
  618. path: 'purchaseLlist',
  619. component: () => import('@/views/businessManager/shopManager/purchase-llist'),
  620. hidden: true,
  621. meta: {
  622. noCache: '1',
  623. title: '进货清单',
  624. belongTopMenu: "/shopManager",
  625. activeMenu: '/shopList',
  626. id: 'xx23'
  627. }
  628. },
  629. {
  630. name: '添加修改商品',
  631. path: 'shopOperation',
  632. component: () => import('@/views/businessManager/shopManager/shopOperation'),
  633. hidden: true,
  634. meta: {
  635. noCache: '1',
  636. title: '添加修改商品',
  637. belongTopMenu: "/shopManager",
  638. activeMenu: '/shopList',
  639. id: 'xx24'
  640. }
  641. },
  642. ])
  643. }
  644. if (route.path == '/systemManager') {
  645. route.children = route.children.concat([{
  646. name: '创建&修改汇付账号',
  647. path: 'adapayOperation',
  648. component: () => import('@/views/adapayAccount/form'),
  649. hidden: true,
  650. meta: {
  651. noCache: '1',
  652. title: '创建&修改汇付账号',
  653. belongTopMenu: "/systemManager",
  654. activeMenu: '/sysBasics/adapayManager',
  655. id: 'xx25'
  656. }
  657. },
  658. {
  659. name: '添加&查看时间充值活动',
  660. path: 'entryOperation',
  661. component: () => import('@/views/app/entryOperation'),
  662. hidden: true,
  663. meta: {
  664. noCache: '1',
  665. title: '添加&查看时间充值活动',
  666. belongTopMenu: "/systemManager",
  667. activeMenu: '/sysBasics/entryActivities',
  668. id: 'xx26'
  669. }
  670. },
  671. {
  672. name: '添加&修改系统权限',
  673. path: 'adminOperation',
  674. component: () => import('@/views/categroyManager/insideSetting/adminOperation'),
  675. hidden: true,
  676. meta: {
  677. noCache: '1',
  678. title: '添加&修改系统权限',
  679. belongTopMenu: "/systemManager",
  680. activeMenu: '/parameter/adminManager',
  681. id: 'xx27'
  682. }
  683. },
  684. // /parameter/adminManager adminOperation
  685. ])
  686. }
  687. })
  688. return accessedRoutes
  689. }
  690. const actions = {
  691. generateRoutes({
  692. commit
  693. }) {
  694. return new Promise(resolve => {
  695. // 获取接口返回的权限菜单
  696. getSilder().then(async res => {
  697. if (res.code == 200) {
  698. let result = addTopMenu(res.data)
  699. if (res.data?.length < 1) {
  700. // 一条权限都没有
  701. //退出 跳到登录页 提示'该账号无任何权限'
  702. // console.log(store.dispatch)
  703. await store.dispatch("user/logout");
  704. localStorage.removeItem("firstMenuUrl");
  705. // await this.$store.dispatch("permission/removePermission")
  706. Message.error('该用户无访问权限')
  707. router.push(`/login`);
  708. // window.location.reload();
  709. }
  710. let newData = recursionRouter(result);
  711. newData = getFirstMenu(newData)
  712. recursionPermission(res.data)
  713. let accessedRoutes
  714. // 生成异步路由表
  715. accessedRoutes = generateAsyncRouter(asyncRoutes, newData)
  716. accessedRoutes = setDetailRoute(accessedRoutes)
  717. // console.log('生成出来的异步路由', accessedRoutes)
  718. // var result = accessedRoutes.concat({ path: '*', redirect: '/404', hidden: true })
  719. commit('SET_ROUTES', accessedRoutes)
  720. // commit('SET_PERMISSION', recursionPermission(res.data).flat(Infinity))
  721. window.localStorage.removeItem('permission')
  722. window.localStorage.setItem('permission', tempArr)
  723. this.dispatch('app/setDotStatus')
  724. resolve(accessedRoutes)
  725. }
  726. })
  727. })
  728. },
  729. removePermission({
  730. commit
  731. }) {
  732. window.localStorage.removeItem('permission')
  733. commit('SET_PERMISSION', [])
  734. }
  735. }
  736. export default {
  737. namespaced: true,
  738. state,
  739. mutations,
  740. actions
  741. }