userInfo.js 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  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: 'x-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: 'x-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 menu = {
  119. perms: [
  120. 'sys:menu:add',
  121. 'sys:menu:delete',
  122. 'sys:menu:update',
  123. 'sys:menu:page',
  124. 'sys:menu:list',
  125. 'sys:menu:info',
  126. 'sys:user:add',
  127. 'sys:user:delete',
  128. 'sys:user:update',
  129. 'sys:user:page',
  130. 'sys:user:list',
  131. 'sys:user:info',
  132. 'sys:role:add',
  133. 'sys:role:delete',
  134. 'sys:role:update',
  135. 'sys:role:page',
  136. 'sys:role:list',
  137. 'sys:role:info',
  138. '1',
  139. 'sys:log:page',
  140. 'sys:log:clear'
  141. ],
  142. menus: [
  143. //注意如果子菜单有多个,父菜单应设置成type=0 !!!!!!!!!!!! shish 2021.3.25
  144. {id: '1',parentId: null,name: '首页',type: 1,icon: 'icongongzuotai',orderNum: 1,router: '/',viewPath: 'views/home.vue',keepAlive: 1},
  145. {id: '101',parentId: 1,name: '今日概况',type: 1,icon: 'icongongzuotai',orderNum: 1,router: '/console/index',viewPath: 'views/home.vue',keepAlive: 1},
  146. {id: '2',parentId: null,name: '客户',type: 0,icon: 'iconkehuguanli',orderNum: 2,router: '/member/list',viewPath: 'views/member/list.vue',keepAlive: 1},
  147. {id: '201',parentId: 2,name: '客户列表',type: 1,icon: 'iconkehuguanli',orderNum: 2,router: '/member/list',viewPath: 'views/member/list.vue',keepAlive: 1},
  148. {id: '3',parentId: null,name: '订单',type: 0,icon: 'icondingdanguanli',orderNum: 3,router: '/order/list',viewPath: 'views/order/list.vue',keepAlive: 1},
  149. {id: '301',parentId: 3,name: '订单列表',type: 1,icon: 'icondingdanguanli',orderNum: 3,router: '/order/list',viewPath: 'views/order/list.vue',keepAlive: 1},
  150. {id: '303',parentId: 3,name: '预订汇总',type: 1,icon: 'icondingdanguanli',orderNum: 3,router: '/order/book',viewPath: 'views/order/book.vue',keepAlive: 1},
  151. {id: '302',parentId: 3,name: '开单',type: 1,icon: 'icondingdanguanli',orderNum: 3,router: '/order/add',viewPath: 'views/order/add.vue',keepAlive: 1},
  152. {id: '1400',parentId: null,name: '采购',type: 0,icon: 'icondingdanguanli',orderNum: 3,router: '/in/list',viewPath: 'views/in/list.vue',keepAlive: 1},
  153. {id: '1405',parentId: 1400,name: '采购记录',type: 1,icon: 'icondingdanguanli',orderNum: 3,router: '/in/list',viewPath: 'views/in/list.vue',keepAlive: 1},
  154. {id: '1410',parentId: 1400,name: '改价入库',type: 1,icon: 'icondingdanguanli',orderNum: 3,router: '/in/change',viewPath: 'views/in/change.vue',keepAlive: 1},
  155. {id: '1415',parentId: 1400,name: '供货商',type: 1,icon: 'icondingdanguanli',orderNum: 3,router: '/in/ghs',viewPath: 'views/in/ghs.vue',keepAlive: 1},
  156. {id: '1420',parentId: 1400,name: '新增采购',type: 1,icon: 'icondingdanguanli',orderNum: 3,router: '/in/add',viewPath: 'views/in/add.vue',keepAlive: 1},
  157. {id: '4',parentId: null,name: '花材',type: 0,icon: 'iconshangpinguanli',orderNum: 4,router: '/item/list',viewPath: 'views/item/list.vue',keepAlive: 1},
  158. {id: '405', parentId: '4',name: '花材列表',type: 1,icon: 'icon-user',orderNum: 4,router: '/item/list',viewPath: 'views/item/list.vue',keepAlive: 1},
  159. {id: '401',parentId: '4',name: '花材分类',type: 1,icon: 'icon-user',orderNum: 4,router: '/item-class/list',viewPath: 'views/item-class/list.vue',keepAlive: 1},
  160. {id: '809',parentId: '4',name: '花材导入',type: 1,icon: 'icongongzuotai',orderNum: 4,router: '/item/import',viewPath: 'views/item/import.vue',keepAlive: 1},
  161. {id: '9',parentId: null,name: '员工',type: 0,icon: 'iconyuangongguanli',orderNum: 9,router: '/staff/list',viewPath: 'views/staff/list.vue',keepAlive: 1},
  162. {id: '902',parentId: '9',name: '员工列表',type: 1,icon: 'iconkehuguanli',orderNum: 9,router: '/staff/list',viewPath: 'views/staff/list.vue',keepAlive: 1},
  163. {id: '903',parentId: '9',name: '角色列表',type: 1,icon: 'iconkehuguanli',orderNum: 9,router: '/role/list',viewPath: 'views/staff/role-list.vue',keepAlive: 1},
  164. {id: '904', parentId: '9',name: '操作记录',type: 1,icon: 'iconkehuguanli',orderNum: 9,router: '/operate/list',viewPath: 'views/staff/operate.vue',keepAlive: 1},
  165. {id: '10',parentId: null,name: '门店',type: 1,icon: 'iconguanggao',orderNum: 10,router: '/shop/list',viewPath: 'views/shop/list.vue',keepAlive: 1},
  166. {id: '1001',parentId: 10,name: '门店列表',type: 1,icon: 'iconguanggao',orderNum: 10,router: '/shop/list',viewPath: 'views/shop/list.vue',keepAlive: 1},
  167. {id: '11',parentId: null,name: '邀请',type: 1,icon: 'iconyaoqingyouli',orderNum: 11,router: '/pages/admin/my-invite',viewPath: 'views/my-invite/index.vue',keepAlive: 1},
  168. {id: '1101',parentId: 11,name: '邀请注册',type: 1,icon: 'iconyaoqingyouli',orderNum: 11,router: '/pages/admin/my-invite',viewPath: 'views/my-invite/index.vue',keepAlive: 1},
  169. {id: '12',parentId: null,name: '资产',type: 0,icon: 'icondingdanguanli',orderNum: 12,router: '/assets/list',viewPath: 'views/assets/list.vue',keepAlive: 1},
  170. {id: '1201',parentId: '12',name: '收入明细',type: 1,icon: 'icondingdanguanli',orderNum: 12,router: '/assets/list',viewPath: 'views/assets/list.vue',keepAlive: 1},
  171. {id: '1202',parentId: '12',name: '支出明细',type: 1,icon: 'icondingdanguanli',orderNum: 12,router: '/assets/expendList',viewPath: 'views/assets/expendList.vue',keepAlive: 1},
  172. {id: '13',parentId: null,name: '设置',type: 0,icon: 'iconshezhi',orderNum: 12,router: '/goods/list',viewPath: 'views/goods/goods-list.vue',keepAlive: 1},
  173. {id: '1301',parentId: '13',name: '密码设置',type: 1,icon: 'iconkehuguanli',orderNum: 12,router: '/setting/set-password',viewPath: 'views/setting/set-password.vue',keepAlive: 1}
  174. ]
  175. };
  176. Mock.mock(RegExp('/comm/permmenu' + '.*'), 'get', req => {
  177. // console.table(req);
  178. return {
  179. code: 1,
  180. data: menu,
  181. message: 'success'
  182. };
  183. });
  184. Mock.mock(RegExp('/sys/user/list' + '.*'), 'get', req => {
  185. // console.table(req);
  186. return {
  187. code: 1,
  188. data: {
  189. list: userList,
  190. pagination: {
  191. page: 1,
  192. size: 20,
  193. total: 6
  194. }
  195. },
  196. message: 'success'
  197. };
  198. });