user.js 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760
  1. import Mock from 'mockjs2'
  2. import { builder } from '../util'
  3. const info = (options) => {
  4. console.log('options', options)
  5. const userInfo = {
  6. 'id': '4291d7da9005377ec9aec4a71ea837f',
  7. 'name': '天野远子',
  8. 'username': 'admin',
  9. 'password': '',
  10. 'avatar': '/avatar2.jpg',
  11. 'status': 1,
  12. 'telephone': '',
  13. 'lastLoginIp': '27.154.74.117',
  14. 'lastLoginTime': 1534837621348,
  15. 'creatorId': 'admin',
  16. 'createTime': 1497160610259,
  17. 'merchantCode': 'TLif2btpzg079h15bk',
  18. 'deleted': 0,
  19. 'roleId': 'admin',
  20. 'role': {}
  21. }
  22. // role
  23. const roleObj = {
  24. 'id': 'admin',
  25. 'name': '管理员',
  26. 'describe': '拥有所有权限',
  27. 'status': 1,
  28. 'creatorId': 'system',
  29. 'createTime': 1497160610259,
  30. 'deleted': 0,
  31. 'permissions': [{
  32. 'roleId': 'admin',
  33. 'permissionId': 'dashboard',
  34. 'permissionName': '仪表盘',
  35. 'actions': '[{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"query","defaultCheck":false,"describe":"查询"},{"action":"get","defaultCheck":false,"describe":"详情"},{"action":"update","defaultCheck":false,"describe":"修改"},{"action":"delete","defaultCheck":false,"describe":"删除"}]',
  36. 'actionEntitySet': [{
  37. 'action': 'add',
  38. 'describe': '新增',
  39. 'defaultCheck': false
  40. }, {
  41. 'action': 'query',
  42. 'describe': '查询',
  43. 'defaultCheck': false
  44. }, {
  45. 'action': 'get',
  46. 'describe': '详情',
  47. 'defaultCheck': false
  48. }, {
  49. 'action': 'update',
  50. 'describe': '修改',
  51. 'defaultCheck': false
  52. }, {
  53. 'action': 'delete',
  54. 'describe': '删除',
  55. 'defaultCheck': false
  56. }],
  57. 'actionList': null,
  58. 'dataAccess': null
  59. }, {
  60. 'roleId': 'admin',
  61. 'permissionId': 'exception',
  62. 'permissionName': '异常页面权限',
  63. 'actions': '[{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"query","defaultCheck":false,"describe":"查询"},{"action":"get","defaultCheck":false,"describe":"详情"},{"action":"update","defaultCheck":false,"describe":"修改"},{"action":"delete","defaultCheck":false,"describe":"删除"}]',
  64. 'actionEntitySet': [{
  65. 'action': 'add',
  66. 'describe': '新增',
  67. 'defaultCheck': false
  68. }, {
  69. 'action': 'query',
  70. 'describe': '查询',
  71. 'defaultCheck': false
  72. }, {
  73. 'action': 'get',
  74. 'describe': '详情',
  75. 'defaultCheck': false
  76. }, {
  77. 'action': 'update',
  78. 'describe': '修改',
  79. 'defaultCheck': false
  80. }, {
  81. 'action': 'delete',
  82. 'describe': '删除',
  83. 'defaultCheck': false
  84. }],
  85. 'actionList': null,
  86. 'dataAccess': null
  87. }, {
  88. 'roleId': 'admin',
  89. 'permissionId': 'result',
  90. 'permissionName': '结果权限',
  91. 'actions': '[{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"query","defaultCheck":false,"describe":"查询"},{"action":"get","defaultCheck":false,"describe":"详情"},{"action":"update","defaultCheck":false,"describe":"修改"},{"action":"delete","defaultCheck":false,"describe":"删除"}]',
  92. 'actionEntitySet': [{
  93. 'action': 'add',
  94. 'describe': '新增',
  95. 'defaultCheck': false
  96. }, {
  97. 'action': 'query',
  98. 'describe': '查询',
  99. 'defaultCheck': false
  100. }, {
  101. 'action': 'get',
  102. 'describe': '详情',
  103. 'defaultCheck': false
  104. }, {
  105. 'action': 'update',
  106. 'describe': '修改',
  107. 'defaultCheck': false
  108. }, {
  109. 'action': 'delete',
  110. 'describe': '删除',
  111. 'defaultCheck': false
  112. }],
  113. 'actionList': null,
  114. 'dataAccess': null
  115. }, {
  116. 'roleId': 'admin',
  117. 'permissionId': 'profile',
  118. 'permissionName': '详细页权限',
  119. 'actions': '[{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"query","defaultCheck":false,"describe":"查询"},{"action":"get","defaultCheck":false,"describe":"详情"},{"action":"update","defaultCheck":false,"describe":"修改"},{"action":"delete","defaultCheck":false,"describe":"删除"}]',
  120. 'actionEntitySet': [{
  121. 'action': 'add',
  122. 'describe': '新增',
  123. 'defaultCheck': false
  124. }, {
  125. 'action': 'query',
  126. 'describe': '查询',
  127. 'defaultCheck': false
  128. }, {
  129. 'action': 'get',
  130. 'describe': '详情',
  131. 'defaultCheck': false
  132. }, {
  133. 'action': 'update',
  134. 'describe': '修改',
  135. 'defaultCheck': false
  136. }, {
  137. 'action': 'delete',
  138. 'describe': '删除',
  139. 'defaultCheck': false
  140. }],
  141. 'actionList': null,
  142. 'dataAccess': null
  143. }, {
  144. 'roleId': 'admin',
  145. 'permissionId': 'table',
  146. 'permissionName': '表格权限',
  147. 'actions': '[{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"import","defaultCheck":false,"describe":"导入"},{"action":"get","defaultCheck":false,"describe":"详情"},{"action":"update","defaultCheck":false,"describe":"修改"}]',
  148. 'actionEntitySet': [{
  149. 'action': 'add',
  150. 'describe': '新增',
  151. 'defaultCheck': false
  152. }, {
  153. 'action': 'import',
  154. 'describe': '导入',
  155. 'defaultCheck': false
  156. }, {
  157. 'action': 'get',
  158. 'describe': '详情',
  159. 'defaultCheck': false
  160. }, {
  161. 'action': 'update',
  162. 'describe': '修改',
  163. 'defaultCheck': false
  164. }],
  165. 'actionList': null,
  166. 'dataAccess': null
  167. }, {
  168. 'roleId': 'admin',
  169. 'permissionId': 'form',
  170. 'permissionName': '表单权限',
  171. 'actions': '[{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"get","defaultCheck":false,"describe":"详情"},{"action":"query","defaultCheck":false,"describe":"查询"},{"action":"update","defaultCheck":false,"describe":"修改"},{"action":"delete","defaultCheck":false,"describe":"删除"}]',
  172. 'actionEntitySet': [{
  173. 'action': 'add',
  174. 'describe': '新增',
  175. 'defaultCheck': false
  176. }, {
  177. 'action': 'get',
  178. 'describe': '详情',
  179. 'defaultCheck': false
  180. }, {
  181. 'action': 'query',
  182. 'describe': '查询',
  183. 'defaultCheck': false
  184. }, {
  185. 'action': 'update',
  186. 'describe': '修改',
  187. 'defaultCheck': false
  188. }, {
  189. 'action': 'delete',
  190. 'describe': '删除',
  191. 'defaultCheck': false
  192. }],
  193. 'actionList': null,
  194. 'dataAccess': null
  195. }, {
  196. 'roleId': 'admin',
  197. 'permissionId': 'order',
  198. 'permissionName': '订单管理',
  199. 'actions': '[{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"query","defaultCheck":false,"describe":"查询"},{"action":"get","defaultCheck":false,"describe":"详情"},{"action":"update","defaultCheck":false,"describe":"修改"},{"action":"delete","defaultCheck":false,"describe":"删除"}]',
  200. 'actionEntitySet': [{
  201. 'action': 'add',
  202. 'describe': '新增',
  203. 'defaultCheck': false
  204. }, {
  205. 'action': 'query',
  206. 'describe': '查询',
  207. 'defaultCheck': false
  208. }, {
  209. 'action': 'get',
  210. 'describe': '详情',
  211. 'defaultCheck': false
  212. }, {
  213. 'action': 'update',
  214. 'describe': '修改',
  215. 'defaultCheck': false
  216. }, {
  217. 'action': 'delete',
  218. 'describe': '删除',
  219. 'defaultCheck': false
  220. }],
  221. 'actionList': null,
  222. 'dataAccess': null
  223. }, {
  224. 'roleId': 'admin',
  225. 'permissionId': 'permission',
  226. 'permissionName': '权限管理',
  227. 'actions': '[{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"get","defaultCheck":false,"describe":"详情"},{"action":"update","defaultCheck":false,"describe":"修改"},{"action":"delete","defaultCheck":false,"describe":"删除"}]',
  228. 'actionEntitySet': [{
  229. 'action': 'add',
  230. 'describe': '新增',
  231. 'defaultCheck': false
  232. }, {
  233. 'action': 'get',
  234. 'describe': '详情',
  235. 'defaultCheck': false
  236. }, {
  237. 'action': 'update',
  238. 'describe': '修改',
  239. 'defaultCheck': false
  240. }, {
  241. 'action': 'delete',
  242. 'describe': '删除',
  243. 'defaultCheck': false
  244. }],
  245. 'actionList': null,
  246. 'dataAccess': null
  247. }, {
  248. 'roleId': 'admin',
  249. 'permissionId': 'role',
  250. 'permissionName': '角色管理',
  251. 'actions': '[{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"get","defaultCheck":false,"describe":"详情"},{"action":"update","defaultCheck":false,"describe":"修改"},{"action":"delete","defaultCheck":false,"describe":"删除"}]',
  252. 'actionEntitySet': [{
  253. 'action': 'add',
  254. 'describe': '新增',
  255. 'defaultCheck': false
  256. }, {
  257. 'action': 'get',
  258. 'describe': '详情',
  259. 'defaultCheck': false
  260. }, {
  261. 'action': 'update',
  262. 'describe': '修改',
  263. 'defaultCheck': false
  264. }, {
  265. 'action': 'delete',
  266. 'describe': '删除',
  267. 'defaultCheck': false
  268. }],
  269. 'actionList': null,
  270. 'dataAccess': null
  271. }, {
  272. 'roleId': 'admin',
  273. 'permissionId': 'table',
  274. 'permissionName': '桌子管理',
  275. 'actions': '[{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"get","defaultCheck":false,"describe":"详情"},{"action":"query","defaultCheck":false,"describe":"查询"},{"action":"update","defaultCheck":false,"describe":"修改"},{"action":"delete","defaultCheck":false,"describe":"删除"}]',
  276. 'actionEntitySet': [{
  277. 'action': 'add',
  278. 'describe': '新增',
  279. 'defaultCheck': false
  280. }, {
  281. 'action': 'get',
  282. 'describe': '详情',
  283. 'defaultCheck': false
  284. }, {
  285. 'action': 'query',
  286. 'describe': '查询',
  287. 'defaultCheck': false
  288. }, {
  289. 'action': 'update',
  290. 'describe': '修改',
  291. 'defaultCheck': false
  292. }, {
  293. 'action': 'delete',
  294. 'describe': '删除',
  295. 'defaultCheck': false
  296. }],
  297. 'actionList': null,
  298. 'dataAccess': null
  299. }, {
  300. 'roleId': 'admin',
  301. 'permissionId': 'user',
  302. 'permissionName': '用户管理',
  303. 'actions': '[{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"import","defaultCheck":false,"describe":"导入"},{"action":"get","defaultCheck":false,"describe":"详情"},{"action":"update","defaultCheck":false,"describe":"修改"},{"action":"delete","defaultCheck":false,"describe":"删除"},{"action":"export","defaultCheck":false,"describe":"导出"}]',
  304. 'actionEntitySet': [{
  305. 'action': 'add',
  306. 'describe': '新增',
  307. 'defaultCheck': false
  308. }, {
  309. 'action': 'import',
  310. 'describe': '导入',
  311. 'defaultCheck': false
  312. }, {
  313. 'action': 'get',
  314. 'describe': '详情',
  315. 'defaultCheck': false
  316. }, {
  317. 'action': 'update',
  318. 'describe': '修改',
  319. 'defaultCheck': false
  320. }, {
  321. 'action': 'delete',
  322. 'describe': '删除',
  323. 'defaultCheck': false
  324. }, {
  325. 'action': 'export',
  326. 'describe': '导出',
  327. 'defaultCheck': false
  328. }],
  329. 'actionList': null,
  330. 'dataAccess': null
  331. }]
  332. }
  333. roleObj.permissions.push({
  334. 'roleId': 'admin',
  335. 'permissionId': 'support',
  336. 'permissionName': '超级模块',
  337. 'actions': '[{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"import","defaultCheck":false,"describe":"导入"},{"action":"get","defaultCheck":false,"describe":"详情"},{"action":"update","defaultCheck":false,"describe":"修改"},{"action":"delete","defaultCheck":false,"describe":"删除"},{"action":"export","defaultCheck":false,"describe":"导出"}]',
  338. 'actionEntitySet': [{
  339. 'action': 'add',
  340. 'describe': '新增',
  341. 'defaultCheck': false
  342. }, {
  343. 'action': 'import',
  344. 'describe': '导入',
  345. 'defaultCheck': false
  346. }, {
  347. 'action': 'get',
  348. 'describe': '详情',
  349. 'defaultCheck': false
  350. }, {
  351. 'action': 'update',
  352. 'describe': '修改',
  353. 'defaultCheck': false
  354. }, {
  355. 'action': 'delete',
  356. 'describe': '删除',
  357. 'defaultCheck': false
  358. }, {
  359. 'action': 'export',
  360. 'describe': '导出',
  361. 'defaultCheck': false
  362. }],
  363. 'actionList': null,
  364. 'dataAccess': null
  365. })
  366. userInfo.role = roleObj
  367. return builder(userInfo)
  368. }
  369. const userNav = (options) => {
  370. const nav = [
  371. // dashboard
  372. {
  373. 'name': 'dashboard',
  374. 'parentId': 0,
  375. 'id': 1,
  376. 'meta': {
  377. 'icon': 'dashboard',
  378. 'title': '仪表盘',
  379. 'show': true
  380. },
  381. 'component': 'RouteView',
  382. 'redirect': '/dashboard/workplace'
  383. },
  384. {
  385. 'name': 'workplace',
  386. 'parentId': 1,
  387. 'id': 7,
  388. 'meta': {
  389. 'title': '工作台',
  390. 'show': true
  391. },
  392. 'component': 'Workplace'
  393. },
  394. {
  395. 'name': 'monitor',
  396. 'path': 'https://www.baidu.com/',
  397. 'parentId': 1,
  398. 'id': 3,
  399. 'meta': {
  400. 'title': '监控页(外部)',
  401. 'target': '_blank',
  402. 'show': true
  403. }
  404. },
  405. {
  406. 'name': 'Analysis',
  407. 'parentId': 1,
  408. 'id': 2,
  409. 'meta': {
  410. 'title': '分析页',
  411. 'show': true
  412. },
  413. 'component': 'Analysis',
  414. 'path': '/dashboard/analysis'
  415. },
  416. // form
  417. {
  418. 'name': 'form',
  419. 'parentId': 0,
  420. 'id': 10,
  421. 'meta': {
  422. 'icon': 'form',
  423. 'title': '表单页'
  424. },
  425. 'redirect': '/form/base-form',
  426. 'component': 'PageView'
  427. },
  428. {
  429. 'name': 'basic-form',
  430. 'parentId': 10,
  431. 'id': 6,
  432. 'meta': {
  433. 'title': '基础表单'
  434. },
  435. 'component': 'BasicForm'
  436. },
  437. {
  438. 'name': 'step-form',
  439. 'parentId': 10,
  440. 'id': 5,
  441. 'meta': {
  442. 'title': '分步表单'
  443. },
  444. 'component': 'StepForm'
  445. },
  446. {
  447. 'name': 'advanced-form',
  448. 'parentId': 10,
  449. 'id': 4,
  450. 'meta': {
  451. 'title': '高级表单'
  452. },
  453. 'component': 'AdvanceForm'
  454. },
  455. // list
  456. {
  457. 'name': 'list',
  458. 'parentId': 0,
  459. 'id': 10010,
  460. 'meta': {
  461. 'icon': 'table',
  462. 'title': '列表页',
  463. 'show': true
  464. },
  465. 'redirect': '/list/table-list',
  466. 'component': 'PageView'
  467. },
  468. {
  469. 'name': 'table-list',
  470. 'parentId': 10010,
  471. 'id': 10011,
  472. 'path': '/list/table-list/:pageNo([1-9]\\d*)?',
  473. 'meta': {
  474. 'title': '查询表格',
  475. 'show': true
  476. },
  477. 'component': 'TableList'
  478. },
  479. {
  480. 'name': 'basic-list',
  481. 'parentId': 10010,
  482. 'id': 10012,
  483. 'meta': {
  484. 'title': '标准列表',
  485. 'show': true
  486. },
  487. 'component': 'StandardList'
  488. },
  489. {
  490. 'name': 'card',
  491. 'parentId': 10010,
  492. 'id': 10013,
  493. 'meta': {
  494. 'title': '卡片列表',
  495. 'show': true
  496. },
  497. 'component': 'CardList'
  498. },
  499. {
  500. 'name': 'search',
  501. 'parentId': 10010,
  502. 'id': 10014,
  503. 'meta': {
  504. 'title': '搜索列表',
  505. 'show': true
  506. },
  507. 'redirect': '/list/search/article',
  508. 'component': 'SearchLayout'
  509. },
  510. {
  511. 'name': 'article',
  512. 'parentId': 10014,
  513. 'id': 10015,
  514. 'meta': {
  515. 'title': '搜索列表(文章)',
  516. 'show': true
  517. },
  518. 'component': 'SearchArticles'
  519. },
  520. {
  521. 'name': 'project',
  522. 'parentId': 10014,
  523. 'id': 10016,
  524. 'meta': {
  525. 'title': '搜索列表(项目)',
  526. 'show': true
  527. },
  528. 'component': 'SearchProjects'
  529. },
  530. {
  531. 'name': 'application',
  532. 'parentId': 10014,
  533. 'id': 10017,
  534. 'meta': {
  535. 'title': '搜索列表(应用)',
  536. 'show': true
  537. },
  538. 'component': 'SearchApplications'
  539. },
  540. // profile
  541. {
  542. 'name': 'profile',
  543. 'parentId': 0,
  544. 'id': 10018,
  545. 'meta': {
  546. 'title': '详情页',
  547. 'icon': 'profile',
  548. 'show': true
  549. },
  550. 'redirect': '/profile/basic',
  551. 'component': 'RouteView'
  552. },
  553. {
  554. 'name': 'basic',
  555. 'parentId': 10018,
  556. 'id': 10019,
  557. 'meta': {
  558. 'title': '基础详情页',
  559. 'show': true
  560. },
  561. 'component': 'ProfileBasic'
  562. },
  563. {
  564. 'name': 'advanced',
  565. 'parentId': 10018,
  566. 'id': 10020,
  567. 'meta': {
  568. 'title': '高级详情页',
  569. 'show': true
  570. },
  571. 'component': 'ProfileAdvanced'
  572. },
  573. // result
  574. {
  575. 'name': 'result',
  576. 'parentId': 0,
  577. 'id': 10021,
  578. 'meta': {
  579. 'title': '结果页',
  580. 'icon': 'check-circle-o',
  581. 'show': true
  582. },
  583. 'redirect': '/result/success',
  584. 'component': 'PageView'
  585. },
  586. {
  587. 'name': 'success',
  588. 'parentId': 10021,
  589. 'id': 10022,
  590. 'meta': {
  591. 'title': '成功',
  592. 'hiddenHeaderContent': true,
  593. 'show': true
  594. },
  595. 'component': 'ResultSuccess'
  596. },
  597. {
  598. 'name': 'fail',
  599. 'parentId': 10021,
  600. 'id': 10023,
  601. 'meta': {
  602. 'title': '失败',
  603. 'hiddenHeaderContent': true,
  604. 'show': true
  605. },
  606. 'component': 'ResultFail'
  607. },
  608. // Exception
  609. {
  610. 'name': 'exception',
  611. 'parentId': 0,
  612. 'id': 10024,
  613. 'meta': {
  614. 'title': '异常页',
  615. 'icon': 'warning',
  616. 'show': true
  617. },
  618. 'redirect': '/exception/403',
  619. 'component': 'RouteView'
  620. },
  621. {
  622. 'name': '403',
  623. 'parentId': 10024,
  624. 'id': 10025,
  625. 'meta': {
  626. 'title': '403',
  627. 'show': true
  628. },
  629. 'component': 'Exception403'
  630. },
  631. {
  632. 'name': '404',
  633. 'parentId': 10024,
  634. 'id': 10026,
  635. 'meta': {
  636. 'title': '404',
  637. 'show': true
  638. },
  639. 'component': 'Exception404'
  640. },
  641. {
  642. 'name': '500',
  643. 'parentId': 10024,
  644. 'id': 10027,
  645. 'meta': {
  646. 'title': '500',
  647. 'show': true
  648. },
  649. 'component': 'Exception500'
  650. },
  651. // account
  652. {
  653. 'name': 'account',
  654. 'parentId': 0,
  655. 'id': 10028,
  656. 'meta': {
  657. 'title': '个人页',
  658. 'icon': 'user',
  659. 'show': true
  660. },
  661. 'redirect': '/account/center',
  662. 'component': 'RouteView'
  663. },
  664. {
  665. 'name': 'center',
  666. 'parentId': 10028,
  667. 'id': 10029,
  668. 'meta': {
  669. 'title': '个人中心',
  670. 'show': true
  671. },
  672. 'component': 'AccountCenter'
  673. },
  674. // 特殊三级菜单
  675. {
  676. 'name': 'settings',
  677. 'parentId': 10028,
  678. 'id': 10030,
  679. 'meta': {
  680. 'title': '个人设置',
  681. 'hideHeader': true,
  682. 'hideChildren': true,
  683. 'show': true
  684. },
  685. 'redirect': '/account/settings/base',
  686. 'component': 'AccountSettings'
  687. },
  688. {
  689. 'name': 'BaseSettings',
  690. 'path': '/account/settings/base',
  691. 'parentId': 10030,
  692. 'id': 10031,
  693. 'meta': {
  694. 'title': '基本设置',
  695. 'show': false
  696. },
  697. 'component': 'BaseSettings'
  698. },
  699. {
  700. 'name': 'SecuritySettings',
  701. 'path': '/account/settings/security',
  702. 'parentId': 10030,
  703. 'id': 10032,
  704. 'meta': {
  705. 'title': '安全设置',
  706. 'show': false
  707. },
  708. 'component': 'SecuritySettings'
  709. },
  710. {
  711. 'name': 'CustomSettings',
  712. 'path': '/account/settings/custom',
  713. 'parentId': 10030,
  714. 'id': 10033,
  715. 'meta': {
  716. 'title': '个性化设置',
  717. 'show': false
  718. },
  719. 'component': 'CustomSettings'
  720. },
  721. {
  722. 'name': 'BindingSettings',
  723. 'path': '/account/settings/binding',
  724. 'parentId': 10030,
  725. 'id': 10034,
  726. 'meta': {
  727. 'title': '账户绑定',
  728. 'show': false
  729. },
  730. 'component': 'BindingSettings'
  731. },
  732. {
  733. 'name': 'NotificationSettings',
  734. 'path': '/account/settings/notification',
  735. 'parentId': 10030,
  736. 'id': 10034,
  737. 'meta': {
  738. 'title': '新消息通知',
  739. 'show': false
  740. },
  741. 'component': 'NotificationSettings'
  742. }
  743. ]
  744. const json = builder(nav)
  745. console.log('json', json)
  746. return json
  747. }
  748. Mock.mock(/\/api\/user\/info/, 'get', info)
  749. Mock.mock(/\/api\/user\/nav/, 'get', userNav)