userInfo.js 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756
  1. import Mock from 'mockjs';
  2. // import { getUrlParams } from './utils';
  3. let token = {
  4. expire: 9999999,
  5. token:
  6. 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlSWRzIjpbIjEiXSwidXNlcklkIjoiMSIsInBhc3N3b3JkVmVyc2lvbiI6MSwiaWF0IjoxNTczOTc4MzYyLCJleHAiOjE1NzQ1ODMxNjJ9.UOfPFd5cbWaRcaCri4TU2aFZ8_t8KVJzfBFBciDYLdQ'
  7. };
  8. let userList = [
  9. {
  10. id: '21',
  11. name: '测试部门权限2',
  12. password: 'e10adc3949ba59abbe56e057f20f883e',
  13. passwordV: 1,
  14. nickName: '权限2昵称',
  15. headImg: null,
  16. email: null,
  17. remark: null,
  18. status: 1,
  19. createTime: '2019-11-20 15:48:31',
  20. updateTime: '2019-11-20 15:48:31',
  21. username: 'testdp2',
  22. phone: null,
  23. departmentId: '1',
  24. roleName: '只有部门2小组2',
  25. departmentName: 'COOL-ADMIN'
  26. },
  27. {
  28. id: '20',
  29. name: '测试部门权限',
  30. password: 'e10adc3949ba59abbe56e057f20f883e',
  31. passwordV: 1,
  32. nickName: '测试部门权限昵称',
  33. headImg: null,
  34. email: null,
  35. remark: null,
  36. status: 1,
  37. createTime: '2019-11-20 15:39:28',
  38. updateTime: '2019-11-20 15:39:28',
  39. username: 'testdep',
  40. phone: null,
  41. departmentId: '1',
  42. roleName: '只有部门1',
  43. departmentName: 'COOL-ADMIN'
  44. },
  45. {
  46. id: '19',
  47. name: '33',
  48. password: 'e10adc3949ba59abbe56e057f20f883e',
  49. passwordV: 1,
  50. nickName: '333',
  51. headImg: null,
  52. email: null,
  53. remark: null,
  54. status: 1,
  55. createTime: '2019-11-19 00:02:27',
  56. updateTime: '2019-11-19 00:02:27',
  57. username: '333',
  58. phone: null,
  59. departmentId: '17',
  60. roleName: '只有部门1',
  61. departmentName: '小组1'
  62. },
  63. {
  64. id: '18',
  65. name: '阿打算',
  66. password: 'e10adc3949ba59abbe56e057f20f883e',
  67. passwordV: 1,
  68. nickName: '12312',
  69. headImg: null,
  70. email: null,
  71. remark: null,
  72. status: 1,
  73. createTime: '2019-11-18 18:20:04',
  74. updateTime: '2019-11-18 18:20:04',
  75. username: '3123',
  76. phone: null,
  77. departmentId: '13',
  78. roleName: 'testRole',
  79. departmentName: '部门1'
  80. },
  81. {
  82. id: '17',
  83. name: '阿',
  84. password: 'e10adc3949ba59abbe56e057f20f883e',
  85. passwordV: 1,
  86. nickName: '123',
  87. headImg: null,
  88. email: null,
  89. remark: null,
  90. status: 1,
  91. createTime: '2019-11-18 18:07:57',
  92. updateTime: '2019-11-18 18:07:57',
  93. username: '123',
  94. phone: null,
  95. departmentId: '16',
  96. roleName: '超管',
  97. departmentName: '小组2'
  98. },
  99. {
  100. id: '16',
  101. name: 'test',
  102. password: 'e10adc3949ba59abbe56e057f20f883e',
  103. passwordV: 1,
  104. nickName: null,
  105. headImg: null,
  106. email: null,
  107. remark: null,
  108. status: 1,
  109. createTime: '2019-11-11 10:37:43',
  110. updateTime: '2019-11-11 11:17:25',
  111. username: '测试',
  112. phone: null,
  113. departmentId: '14',
  114. roleName: '测试,testRole,超管',
  115. departmentName: '小组1'
  116. }
  117. ];
  118. let userInfo = {
  119. createTime: '2019-06-25 10:20:20',
  120. email: '123456@qq.com',
  121. headImg: 'https://pic.qqtn.com/up/2019-11/2019110209212070747.jpg',
  122. id: '1',
  123. name: '超级管理员',
  124. nickName: '超管',
  125. passwordV: 1,
  126. phone: '18000000000',
  127. remark: '备注',
  128. roleIdList: ['1'],
  129. status: 1,
  130. updateTime: '2019-11-12 09:40:27',
  131. username: 'admin'
  132. };
  133. let menu = {
  134. perms: [
  135. 'sys:menu:add',
  136. 'sys:menu:delete',
  137. 'sys:menu:update',
  138. 'sys:menu:page',
  139. 'sys:menu:list',
  140. 'sys:menu:info',
  141. 'sys:user:add',
  142. 'sys:user:delete',
  143. 'sys:user:update',
  144. 'sys:user:page',
  145. 'sys:user:list',
  146. 'sys:user:info',
  147. 'sys:role:add',
  148. 'sys:role:delete',
  149. 'sys:role:update',
  150. 'sys:role:page',
  151. 'sys:role:list',
  152. 'sys:role:info',
  153. '1',
  154. 'sys:log:page',
  155. 'sys:log:clear'
  156. ],
  157. menus: [
  158. // {
  159. // id: '48',
  160. // parentId: '47',
  161. // name: '文档',
  162. // type: 1,
  163. // icon: 'icon-favorfill',
  164. // orderNum: 0,
  165. // router: '/tutorial/doc',
  166. // viewPath: 'https://docs.cool-admin.com/#/',
  167. // keepAlive: 1
  168. // },
  169. // 工作台
  170. {
  171. id: '1',
  172. parentId: null,
  173. name: '工作台',
  174. type: 0,
  175. icon: 'icongongzuotai',
  176. orderNum: 1,
  177. router: '/',
  178. viewPath: null,
  179. keepAlive: 1
  180. },
  181. // 客户管理
  182. {
  183. id: '2',
  184. parentId: null,
  185. name: '客户管理',
  186. type: 0,
  187. icon: 'iconkehuguanli',
  188. orderNum: 2,
  189. router: '/member/list',
  190. viewPath: 'views/member/list.vue',
  191. keepAlive: 1
  192. },
  193. // 订单管理
  194. {
  195. id: '3',
  196. parentId: null,
  197. name: '订单管理',
  198. type: 0,
  199. icon: 'iconkehuguanli',
  200. orderNum: 2,
  201. router: '/order/list',
  202. viewPath: 'views/order/list.vue',
  203. keepAlive: 1
  204. },
  205. // 商品管理
  206. {
  207. id: '4',
  208. parentId: null,
  209. name: '商品管理',
  210. type: 0,
  211. icon: 'iconkehuguanli',
  212. orderNum: 2,
  213. router: '/goods/list',
  214. viewPath: 'views/goods/goods-list.vue',
  215. keepAlive: 1
  216. },
  217. {
  218. id: '401',
  219. parentId: '4',
  220. name: '商品列表',
  221. type: 1,
  222. icon: 'icon-user',
  223. orderNum: 1,
  224. router: '/goods/list',
  225. viewPath: 'views/goods/goods-list.vue',
  226. keepAlive: 1
  227. },
  228. {
  229. id: '402',
  230. parentId: '4',
  231. name: '图库管理',
  232. type: 1,
  233. icon: 'icon-user',
  234. orderNum: 1,
  235. router: '/goods/img-store',
  236. viewPath: 'views/goods/img-store.vue',
  237. keepAlive: 1
  238. },
  239. {
  240. id: '403',
  241. parentId: '4',
  242. name: '添加商品',
  243. type: 1,
  244. icon: 'icon-user',
  245. orderNum: 1,
  246. router: '/goods/add',
  247. viewPath: 'views/goods/goods-add.vue',
  248. keepAlive: 1
  249. },
  250. {
  251. id: '404',
  252. parentId: '4',
  253. name: '分类管理',
  254. type: 1,
  255. icon: 'icon-user',
  256. orderNum: 1,
  257. router: '/goods/category',
  258. viewPath: 'views/goods/category.vue',
  259. keepAlive: 1
  260. },
  261. {
  262. id: '405',
  263. parentId: '4',
  264. name: '运费设置',
  265. type: 1,
  266. icon: 'icon-user',
  267. orderNum: 1,
  268. router: '/goods/freight',
  269. viewPath: 'views/goods/freight-set.vue',
  270. keepAlive: 1
  271. },
  272. {
  273. id: '406',
  274. parentId: '4',
  275. name: '节日自动涨价',
  276. type: 1,
  277. icon: 'icon-user',
  278. orderNum: 1,
  279. router: '/goods/auto-price',
  280. viewPath: 'views/goods/auto-price.vue',
  281. keepAlive: 1
  282. },
  283. {
  284. id: '406',
  285. parentId: '4',
  286. name: '商品通用简介',
  287. type: 1,
  288. icon: 'icon-user',
  289. orderNum: 1,
  290. router: '/goods/summary',
  291. viewPath: 'views/goods/summary.vue',
  292. keepAlive: 1
  293. },
  294. // 邀请有礼
  295. {
  296. id: '5',
  297. parentId: null,
  298. name: '邀请有礼',
  299. type: 0,
  300. icon: 'iconkehuguanli',
  301. orderNum: 2,
  302. router: '/goods/list',
  303. viewPath: 'views/goods/goods-list.vue',
  304. keepAlive: 1
  305. },
  306. // 优惠券
  307. {
  308. id: '6',
  309. parentId: null,
  310. name: '优惠券',
  311. type: 0,
  312. icon: 'iconkehuguanli',
  313. orderNum: 2,
  314. router: '/goods/list',
  315. viewPath: 'views/goods/goods-list.vue',
  316. keepAlive: 1
  317. },
  318. // 促销
  319. {
  320. id: '7',
  321. parentId: null,
  322. name: '促销',
  323. type: 0,
  324. icon: 'iconkehuguanli',
  325. orderNum: 2,
  326. router: '/goods/list',
  327. viewPath: 'views/goods/goods-list.vue',
  328. keepAlive: 1
  329. },
  330. // 广告管理
  331. {
  332. id: '8',
  333. parentId: null,
  334. name: '广告管理',
  335. type: 0,
  336. icon: 'iconkehuguanli',
  337. orderNum: 2,
  338. router: '/goods/list',
  339. viewPath: 'views/goods/goods-list.vue',
  340. keepAlive: 1
  341. },
  342. // 员工管理
  343. {
  344. id: '9',
  345. parentId: null,
  346. name: '员工管理',
  347. type: 0,
  348. icon: 'iconkehuguanli',
  349. orderNum: 2,
  350. router: '/goods/list',
  351. viewPath: 'views/goods/goods-list.vue',
  352. keepAlive: 1
  353. },
  354. // 设置
  355. {
  356. id: '10',
  357. parentId: null,
  358. name: '设置',
  359. type: 0,
  360. icon: 'iconkehuguanli',
  361. orderNum: 2,
  362. router: '/goods/list',
  363. viewPath: 'views/goods/goods-list.vue',
  364. keepAlive: 1
  365. },
  366. // ========================================================
  367. {
  368. id: '12',
  369. parentId: '8',
  370. name: '新增',
  371. type: 2,
  372. icon: null,
  373. orderNum: 1,
  374. router: null,
  375. viewPath: null,
  376. keepAlive: 0
  377. },
  378. {
  379. id: '203',
  380. parentId: '27',
  381. name: '商品列表',
  382. type: 1,
  383. icon: 'icon-user',
  384. orderNum: 1,
  385. router: '/goods/list',
  386. viewPath: 'views/goods/goods-list.vue',
  387. keepAlive: 1
  388. },
  389. {
  390. id: '200',
  391. parentId: '27',
  392. name: '订单列表',
  393. type: 1,
  394. icon: 'icon-user',
  395. orderNum: 1,
  396. router: '/order/list',
  397. viewPath: 'views/order/list.vue',
  398. keepAlive: 1
  399. },
  400. {
  401. id: '201',
  402. parentId: '27',
  403. name: '客户列表',
  404. type: 1,
  405. icon: 'icon-user',
  406. orderNum: 1,
  407. router: '/member/list',
  408. viewPath: 'views/member/list.vue',
  409. keepAlive: 1
  410. },
  411. {
  412. id: '17',
  413. parentId: '27',
  414. name: '用户列表',
  415. type: 1,
  416. icon: 'icon-user',
  417. orderNum: 1,
  418. router: '/sys/user',
  419. viewPath: 'views/system/user/index.vue',
  420. keepAlive: 1
  421. },
  422. {
  423. id: '18',
  424. parentId: '17',
  425. name: '新增',
  426. type: 2,
  427. icon: null,
  428. orderNum: 1,
  429. router: null,
  430. viewPath: null,
  431. keepAlive: 0
  432. },
  433. {
  434. id: '23',
  435. parentId: '22',
  436. name: '新增',
  437. type: 2,
  438. icon: null,
  439. orderNum: 1,
  440. router: null,
  441. viewPath: null,
  442. keepAlive: 0
  443. },
  444. {
  445. id: '27',
  446. parentId: null,
  447. name: '权限管理',
  448. type: 0,
  449. icon: 'icon-permission',
  450. orderNum: 1,
  451. router: null,
  452. viewPath: null,
  453. keepAlive: 0
  454. },
  455. {
  456. id: '29',
  457. parentId: '28',
  458. name: '日志列表',
  459. type: 1,
  460. icon: 'icon-log',
  461. orderNum: 1,
  462. router: '/sys/log',
  463. viewPath: 'views/system/log/index.vue',
  464. keepAlive: 0
  465. },
  466. {
  467. id: '30',
  468. parentId: '29',
  469. name: '权限',
  470. type: 2,
  471. icon: null,
  472. orderNum: 1,
  473. router: null,
  474. viewPath: null,
  475. keepAlive: 0
  476. },
  477. {
  478. id: '38',
  479. parentId: '8',
  480. name: '11111',
  481. type: 0,
  482. icon: null,
  483. orderNum: 1,
  484. router: null,
  485. viewPath: null,
  486. keepAlive: 1
  487. },
  488. {
  489. id: '43',
  490. parentId: '45',
  491. name: 'crud 示例',
  492. type: 1,
  493. icon: 'icon-radioboxfill',
  494. orderNum: 1,
  495. router: '/crud',
  496. viewPath: 'views/test/crud.vue',
  497. keepAlive: 1
  498. },
  499. {
  500. id: '53',
  501. parentId: '1',
  502. name: '组件预览',
  503. type: 1,
  504. icon: 'icon-activityfill',
  505. orderNum: 1,
  506. router: '/ui-components',
  507. viewPath: 'views/workbench/ui-components',
  508. keepAlive: 1
  509. },
  510. {
  511. id: '11',
  512. parentId: null,
  513. name: '系统',
  514. type: 0,
  515. icon: 'icon-systemfill',
  516. orderNum: 2,
  517. router: '/sys',
  518. viewPath: null,
  519. keepAlive: 1
  520. },
  521. {
  522. id: '8',
  523. parentId: '27',
  524. name: '菜单列表',
  525. type: 1,
  526. icon: 'icon-menu',
  527. orderNum: 2,
  528. router: '/sys/menu',
  529. viewPath: 'views/system/menu/index.vue',
  530. keepAlive: 1
  531. },
  532. {
  533. id: '11',
  534. parentId: '8',
  535. name: '删除',
  536. type: 2,
  537. icon: null,
  538. orderNum: 2,
  539. router: null,
  540. viewPath: null,
  541. keepAlive: 0
  542. },
  543. {
  544. id: '19',
  545. parentId: '17',
  546. name: '删除',
  547. type: 2,
  548. icon: null,
  549. orderNum: 2,
  550. router: null,
  551. viewPath: null,
  552. keepAlive: 0
  553. },
  554. {
  555. id: '24',
  556. parentId: '22',
  557. name: '删除',
  558. type: 2,
  559. icon: null,
  560. orderNum: 2,
  561. router: null,
  562. viewPath: null,
  563. keepAlive: 0
  564. },
  565. {
  566. id: '28',
  567. parentId: '11',
  568. name: '系统监控',
  569. type: 0,
  570. icon: 'icon-monitor',
  571. orderNum: 2,
  572. router: null,
  573. viewPath: null,
  574. keepAlive: 0
  575. },
  576. {
  577. id: '45',
  578. parentId: '1',
  579. name: '组件库',
  580. type: 0,
  581. icon: 'icon-activityfill',
  582. orderNum: 2,
  583. router: '/ui-lib',
  584. viewPath: null,
  585. keepAlive: 1
  586. },
  587. // {
  588. // id: '46',
  589. // parentId: '45',
  590. // name: 'Froala富文本',
  591. // type: 1,
  592. // icon: 'icon-radioboxfill',
  593. // orderNum: 2,
  594. // router: '/editor-froala',
  595. // viewPath: 'views/test/editor-froala.vue',
  596. // keepAlive: 1
  597. // },
  598. {
  599. id: '12',
  600. parentId: '8',
  601. name: '修改',
  602. type: 2,
  603. icon: null,
  604. orderNum: 3,
  605. router: null,
  606. viewPath: null,
  607. keepAlive: 0
  608. },
  609. {
  610. id: '20',
  611. parentId: '17',
  612. name: '修改',
  613. type: 2,
  614. icon: null,
  615. orderNum: 3,
  616. router: null,
  617. viewPath: null,
  618. keepAlive: 0
  619. },
  620. {
  621. id: '22',
  622. parentId: '27',
  623. name: '角色列表',
  624. type: 1,
  625. icon: 'icon-role',
  626. orderNum: 3,
  627. router: '/sys/role',
  628. viewPath: 'views/system/role/index.vue',
  629. keepAlive: 1
  630. },
  631. {
  632. id: '25',
  633. parentId: '22',
  634. name: '修改',
  635. type: 2,
  636. icon: null,
  637. orderNum: 3,
  638. router: null,
  639. viewPath: null,
  640. keepAlive: 0
  641. },
  642. // {
  643. // id: '47',
  644. // parentId: null,
  645. // name: '教程',
  646. // type: 0,
  647. // icon: 'icon-weibiaoti4',
  648. // orderNum: 3,
  649. // router: '/tutorial',
  650. // viewPath: null,
  651. // keepAlive: 1
  652. // },
  653. {
  654. id: '49',
  655. parentId: '45',
  656. name: 'Quill富文本',
  657. type: 1,
  658. icon: 'icon-radioboxfill',
  659. orderNum: 3,
  660. router: '/editor-quill',
  661. viewPath: 'views/test/editor-quill.vue',
  662. keepAlive: 1
  663. },
  664. {
  665. id: '13',
  666. parentId: '8',
  667. name: '查询',
  668. type: 2,
  669. icon: null,
  670. orderNum: 4,
  671. router: null,
  672. viewPath: null,
  673. keepAlive: 0
  674. },
  675. {
  676. id: '21',
  677. parentId: '17',
  678. name: '查询',
  679. type: 2,
  680. icon: null,
  681. orderNum: 4,
  682. router: null,
  683. viewPath: null,
  684. keepAlive: 0
  685. },
  686. {
  687. id: '26',
  688. parentId: '22',
  689. name: '查询',
  690. type: 2,
  691. icon: null,
  692. orderNum: 4,
  693. router: null,
  694. viewPath: null,
  695. keepAlive: 0
  696. },
  697. {
  698. id: '51',
  699. parentId: '10',
  700. name: '测试404页面',
  701. type: 1,
  702. icon: 'icon-newfill',
  703. orderNum: 10,
  704. router: '/test',
  705. viewPath: null,
  706. keepAlive: 1
  707. }
  708. ]
  709. };
  710. // Mock.mock(RegExp('/auth/login' + '.*'), 'get', req => {
  711. // console.table(req);
  712. // return {
  713. // code: 1000,
  714. // data: token,
  715. // message: 'success'
  716. // };
  717. // });
  718. Mock.mock(RegExp('/comm/person' + '.*'), 'get', req => {
  719. // console.table(req);
  720. return {
  721. code: 1,
  722. data: userInfo,
  723. message: 'success'
  724. };
  725. });
  726. Mock.mock(RegExp('/comm/permmenu' + '.*'), 'get', req => {
  727. // console.table(req);
  728. return {
  729. code: 1,
  730. data: menu,
  731. message: 'success'
  732. };
  733. });
  734. Mock.mock(RegExp('/sys/user/list' + '.*'), 'get', req => {
  735. // console.table(req);
  736. return {
  737. code: 1,
  738. data: {
  739. list: userList,
  740. pagination: {
  741. page: 1,
  742. size: 20,
  743. total: 6
  744. }
  745. },
  746. message: 'success'
  747. };
  748. });