userInfo.js 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  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: '',
  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: '',
  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: '',
  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: '',
  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: '',
  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: '',
  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: '',
  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. {id: '9',parentId: null,name: '控制台',type: 0,icon: 'icongongzuotai',orderNum: 1,router: '',viewPath: '',keepAlive: 1},
  159. {id: '91',parentId: '9',name: '今日概况',type: 1,icon: 'icongongzuotai',orderNum: 1,router: '/',viewPath: 'Home',keepAlive: 1},
  160. {id: '1',parentId: null,name: '商家',type: 0,icon: 'icongongzuotai',orderNum: 1,router: '',viewPath: '',keepAlive: 1},
  161. {id: '11',parentId: '1',name: '申请记录',type: 1,icon: 'icongongzuotai',orderNum: 1,router: '/saas/shop/apply',viewPath: 'saas/shop/apply',keepAlive: 1},
  162. {id: '13',parentId: '1',name: '门店管理',type: 1,icon: 'icongongzuotai',orderNum: 1,router: '/saas/shop/shop',viewPath: 'saas/shop/shop',keepAlive: 1},
  163. {id: '12',parentId: '1',name: '商家列表',type: 1,icon: 'icongongzuotai',orderNum: 1,router: '/saas/shop/list',viewPath: 'saas/shop/list',keepAlive: 1},
  164. {id: '14',parentId: '1',name: '员工管理',type: 1,icon: 'icongongzuotai',orderNum: 1,router: '/saas/shop/manage',viewPath: 'saas/shop/manage',keepAlive: 1},
  165. {id: '15',parentId: '1',name: '小程序',type: 1,icon: 'icongongzuotai',orderNum: 1,router: '/saas/shop/upgrade',viewPath: 'saas/shop/upgrade',keepAlive: 1},
  166. {id: '16',parentId: '1',name: '付费订单',type: 1,icon: 'icongongzuotai',orderNum: 1,router: '/saas/shop/buy',viewPath: 'saas/shop/buy',keepAlive: 1},
  167. {id: '17',parentId: '1',name: '提现申请',type: 1,icon: 'icongongzuotai',orderNum: 1,router: '/saas/shop/deposit',viewPath: 'saas/shop/deposit',keepAlive: 1},
  168. {id: '10',parentId: null,name: '资产',type: 0,icon: 'icongongzuotai',orderNum: 1,router: '',viewPath: '',keepAlive: 1},
  169. {id: '101',parentId: '10',name: '余额明细',type: 1,icon: 'icongongzuotai',orderNum: 1,router: '/assets/ptYeChange',viewPath: 'views/assets/ptYeChange',keepAlive: 1},
  170. {id: '2',parentId: null,name: '订单',type: 1,icon: 'icongongzuotai',orderNum: 2,router: '/saas/order/list',viewPath: 'saas/order/list',keepAlive: 1},
  171. {id: '3',parentId: null,name: '客户',type: 1,icon: 'icongongzuotai',orderNum: 3,router: '/saas/member/list',viewPath: 'saas/member/list',keepAlive: 1},
  172. {id: '4',parentId: null,name: '店长',type: 1,icon: 'icongongzuotai',orderNum: 4,router: '/saas/pt-member/list',viewPath: 'saas/pt-member/list',keepAlive: 1},
  173. {id: '5',parentId: null,name: '商品',type: 1,icon: 'icongongzuotai',orderNum: 5,router: '/saas/goods/list',viewPath: 'saas/goods/list',keepAlive: 1},
  174. {id: '6',parentId: null,name: '节日',type: 1,icon: 'icongongzuotai',orderNum: 6,router: '/saas/fest/list',viewPath: 'saas/fest/list',keepAlive: 1},
  175. {id: '8',parentId: null,name: '花材',type: 0,icon: 'icongongzuotai',orderNum: 4,router: '/item/list',viewPath: 'views/item/list.vue',keepAlive: 1},
  176. {id: '805',parentId: '8',name: '花材分类',type: 1,icon: 'icongongzuotai',orderNum: 4,router: '/item-class/list',viewPath: 'views/item-class/list.vue',keepAlive: 1},
  177. {id: '810',parentId: '8',name: '花材列表',type: 1,icon: 'icongongzuotai',orderNum: 4,router: '/item/list',viewPath: 'views/item/list.vue',keepAlive: 1},
  178. {id: '806',parentId: '8',name: '花材分类(供)',type: 1,icon: 'icongongzuotai',orderNum: 4,router: '/item-cat/list',viewPath: 'views/item-cat/list.vue',keepAlive: 1},
  179. {id: '810',parentId: '8',name: '花材列表(供)',type: 1,icon: 'icongongzuotai',orderNum: 4,router: '/item-cat-relate/list',viewPath: 'views/item-cat-relate/list.vue',keepAlive: 1},
  180. {id: '7',parentId: null,name: '套餐',type: 0,icon: 'icongongzuotai',orderNum: 7,router: '/saas/manage/list',viewPath: 'saas/manage/list',keepAlive: 1},
  181. {id: '701',parentId: '7',name: '套餐列表',type: 1,icon: 'icongongzuotai',orderNum: 7,router: '/saas/manage/package',viewPath: 'saas/manage/package',keepAlive: 1},
  182. {id: '701',parentId: '7',name: '权限',type: 1,icon: 'icongongzuotai',orderNum: 7,router: '/saas/manage/auth',viewPath: 'saas/manage/auth',keepAlive: 1},
  183. ]
  184. };
  185. // Mock.mock(RegExp('/auth/login' + '.*'), 'get', req => {
  186. // // console.table(req);
  187. // return {
  188. // code: 1,
  189. // data: userInfo,
  190. // message: 'success'
  191. // };
  192. // });
  193. Mock.mock(RegExp('/comm/permmenu' + '.*'), 'get', req => {
  194. // console.table(req);
  195. return {
  196. code: 1,
  197. data: menu,
  198. message: 'success'
  199. };
  200. });
  201. Mock.mock(RegExp('/sys/user/list' + '.*'), 'get', req => {
  202. // console.table(req);
  203. return {
  204. code: 1,
  205. data: {
  206. list: userList,
  207. pagination: {
  208. page: 1,
  209. size: 20,
  210. total: 6
  211. }
  212. },
  213. message: 'success'
  214. };
  215. });