userInfo.js 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392
  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: '1',
  184. parentId: null,
  185. name: '商家管理',
  186. type: 0,
  187. icon: 'icongongzuotai',
  188. orderNum: 1,
  189. router: '/sass/shop-list',
  190. viewPath: null,
  191. keepAlive: 1
  192. },
  193. {
  194. id: '11',
  195. parentId: '1',
  196. name: '商家列表',
  197. type: 1,
  198. icon: 'icongongzuotai',
  199. orderNum: 1,
  200. router: '/sass/merchant/merchant-list',
  201. viewPath: 'sass/shop/list',
  202. keepAlive: 1
  203. },
  204. {
  205. id: '12',
  206. parentId: '1',
  207. name: '申请记录',
  208. type: 1,
  209. icon: 'icongongzuotai',
  210. orderNum: 1,
  211. router: '/',
  212. viewPath: null,
  213. keepAlive: 1
  214. },
  215. {
  216. id: '13',
  217. parentId: '1',
  218. name: '小程序升级',
  219. type: 1,
  220. icon: 'icongongzuotai',
  221. orderNum: 1,
  222. router: '/',
  223. viewPath: null,
  224. keepAlive: 1
  225. },
  226. {
  227. id: '14',
  228. parentId: '1',
  229. name: '门店',
  230. type: 1,
  231. icon: 'icongongzuotai',
  232. orderNum: 1,
  233. router: '/sass/merchant/shop-list',
  234. viewPath: 'sass/shop/shop',
  235. keepAlive: 1
  236. },
  237. {
  238. id: '14',
  239. parentId: '1',
  240. name: '购买记录',
  241. type: 1,
  242. icon: 'icongongzuotai',
  243. orderNum: 1,
  244. router: '/sass/merchant/buy-list',
  245. viewPath: 'sass/shop/buy',
  246. keepAlive: 1
  247. },
  248. // 订单管理
  249. {
  250. id: '2',
  251. parentId: null,
  252. name: '订单管理',
  253. type: 1,
  254. icon: 'icongongzuotai',
  255. orderNum: 1,
  256. router: '/sass/order/list',
  257. viewPath: 'sass/order/list',
  258. keepAlive: 1
  259. },
  260. // 商家客户
  261. {
  262. id: '3',
  263. parentId: null,
  264. name: '客户列表',
  265. type: 1,
  266. icon: 'icongongzuotai',
  267. orderNum: 1,
  268. router: '/sass/member/list',
  269. viewPath: 'sass/member/list',
  270. keepAlive: 1
  271. },
  272. // 花卉宝商家客户
  273. {
  274. id: '4',
  275. parentId: null,
  276. name: '花卉宝客户',
  277. type: 1,
  278. icon: 'icongongzuotai',
  279. orderNum: 1,
  280. router: '/sass/pt-member/list',
  281. viewPath: 'sass/pt-member/list',
  282. keepAlive: 1
  283. },
  284. // 商家商品
  285. {
  286. id: '5',
  287. parentId: null,
  288. name: '商品列表',
  289. type: 1,
  290. icon: 'icongongzuotai',
  291. orderNum: 1,
  292. router: '/sass/goods/list',
  293. viewPath: 'sass/goods/list',
  294. keepAlive: 1
  295. },
  296. // 节日管理
  297. {
  298. id: '6',
  299. parentId: null,
  300. name: '节日列表',
  301. type: 1,
  302. icon: 'icongongzuotai',
  303. orderNum: 1,
  304. router: '/sass/fest/list',
  305. viewPath: 'sass/fest/list',
  306. keepAlive: 1
  307. },
  308. // 套餐管理
  309. {
  310. id: '7',
  311. parentId: null,
  312. name: '套餐管理',
  313. type: 0,
  314. icon: 'icongongzuotai',
  315. orderNum: 1,
  316. router: '/sass/manage/list',
  317. viewPath: 'sass/manage/list',
  318. keepAlive: 1
  319. },
  320. {
  321. id: '701',
  322. parentId: '7',
  323. name: '套餐列表',
  324. type: 1,
  325. icon: 'icongongzuotai',
  326. orderNum: 1,
  327. router: '/sass/manage/package',
  328. viewPath: 'sass/manage/package',
  329. keepAlive: 1
  330. },
  331. {
  332. id: '701',
  333. parentId: '7',
  334. name: '权限管理',
  335. type: 1,
  336. icon: 'icongongzuotai',
  337. orderNum: 1,
  338. router: '/sass/manage/auth',
  339. viewPath: 'sass/manage/auth',
  340. keepAlive: 1
  341. },
  342. {
  343. id: '8',
  344. parentId: null,
  345. name: '权限',
  346. type: 1,
  347. icon: null,
  348. orderNum: 1,
  349. router: null,
  350. viewPath: null,
  351. keepAlive: 0
  352. }
  353. ]
  354. };
  355. // Mock.mock(RegExp('/auth/login' + '.*'), 'get', req => {
  356. // // console.table(req);
  357. // return {
  358. // code: 1,
  359. // data: userInfo,
  360. // message: 'success'
  361. // };
  362. // });
  363. Mock.mock(RegExp('/comm/permmenu' + '.*'), 'get', req => {
  364. // console.table(req);
  365. return {
  366. code: 1,
  367. data: menu,
  368. message: 'success'
  369. };
  370. });
  371. Mock.mock(RegExp('/sys/user/list' + '.*'), 'get', req => {
  372. // console.table(req);
  373. return {
  374. code: 1,
  375. data: {
  376. list: userList,
  377. pagination: {
  378. page: 1,
  379. size: 20,
  380. total: 6
  381. }
  382. },
  383. message: 'success'
  384. };
  385. });