system.ts 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  1. import { MockMethod } from "vite-plugin-mock";
  2. export default [
  3. {
  4. url: "/role",
  5. method: "post",
  6. response: () => {
  7. return {
  8. code: 0,
  9. data: {
  10. list: [
  11. {
  12. createTime: 1609837428000,
  13. updateTime: 1645477701000,
  14. creator: "admin",
  15. updater: "",
  16. deleted: false,
  17. tenantId: 1,
  18. id: 1,
  19. name: "超级管理员",
  20. code: "super_admin",
  21. sort: 1,
  22. status: 0,
  23. type: 1,
  24. remark: "超级管理员",
  25. dataScope: 1,
  26. dataScopeDeptIds: null
  27. },
  28. {
  29. createTime: 1609837428000,
  30. updateTime: 1645477700000,
  31. creator: "admin",
  32. updater: "",
  33. deleted: false,
  34. tenantId: 1,
  35. id: 2,
  36. name: "普通角色",
  37. code: "common",
  38. sort: 2,
  39. status: 0,
  40. type: 1,
  41. remark: "普通角色",
  42. dataScope: 2,
  43. dataScopeDeptIds: null
  44. },
  45. {
  46. createTime: 1609912175000,
  47. updateTime: 1647698441000,
  48. creator: "",
  49. updater: "1",
  50. deleted: false,
  51. tenantId: 1,
  52. id: 101,
  53. name: "测试账号",
  54. code: "test",
  55. sort: 0,
  56. status: 0,
  57. type: 2,
  58. remark: "132",
  59. dataScope: 1,
  60. dataScopeDeptIds: []
  61. }
  62. ],
  63. total: 3
  64. }
  65. };
  66. }
  67. },
  68. {
  69. url: "/dept",
  70. method: "post",
  71. response: () => {
  72. return {
  73. code: 0,
  74. data: [
  75. {
  76. name: "杭州总公司",
  77. type: 1, // 1 公司 2 分公司 3 部门
  78. parentId: 0,
  79. sort: 0,
  80. leaderUserId: 1,
  81. phone: "15888888888",
  82. email: "ry@qq.com",
  83. status: 0,
  84. id: 100,
  85. createTime: 1609837427000,
  86. remark: "备注、备注、备注、备注、备注、备注、备注"
  87. },
  88. {
  89. name: "郑州分公司",
  90. type: 2,
  91. parentId: 100,
  92. sort: 1,
  93. leaderUserId: 104,
  94. phone: "15888888888",
  95. email: "ry@qq.com",
  96. status: 0,
  97. id: 101,
  98. createTime: 1609837427000,
  99. remark: "备注、备注、备注、备注、备注、备注、备注"
  100. },
  101. {
  102. name: "研发部门",
  103. type: 3,
  104. parentId: 101,
  105. sort: 1,
  106. leaderUserId: 104,
  107. phone: "15888888888",
  108. email: "ry@qq.com",
  109. status: 0,
  110. id: 103,
  111. createTime: 1609837427000,
  112. remark: "备注、备注、备注、备注、备注、备注、备注"
  113. },
  114. {
  115. name: "市场部门",
  116. type: 3,
  117. parentId: 102,
  118. sort: 1,
  119. leaderUserId: null,
  120. phone: "15888888888",
  121. email: "ry@qq.com",
  122. status: 0,
  123. id: 108,
  124. createTime: 1609837427000,
  125. remark: "备注、备注、备注、备注、备注、备注、备注"
  126. },
  127. {
  128. name: "深圳分公司",
  129. type: 2,
  130. parentId: 100,
  131. sort: 2,
  132. leaderUserId: null,
  133. phone: "15888888888",
  134. email: "ry@qq.com",
  135. status: 0,
  136. id: 102,
  137. createTime: 1609837427000,
  138. remark: "备注、备注、备注、备注、备注、备注、备注"
  139. },
  140. {
  141. name: "市场部门",
  142. type: 3,
  143. parentId: 101,
  144. sort: 2,
  145. leaderUserId: null,
  146. phone: "15888888888",
  147. email: "ry@qq.com",
  148. status: 1,
  149. id: 104,
  150. createTime: 1609837427000,
  151. remark: "备注、备注、备注、备注、备注、备注、备注"
  152. },
  153. {
  154. name: "财务部门",
  155. type: 3,
  156. parentId: 102,
  157. sort: 2,
  158. leaderUserId: null,
  159. phone: "15888888888",
  160. email: "ry@qq.com",
  161. status: 0,
  162. id: 109,
  163. createTime: 1609837427000,
  164. remark: "备注、备注、备注、备注、备注、备注、备注"
  165. },
  166. {
  167. name: "测试部门",
  168. type: 3,
  169. parentId: 101,
  170. sort: 3,
  171. leaderUserId: null,
  172. phone: "15888888888",
  173. email: "ry@qq.com",
  174. status: 0,
  175. id: 105,
  176. createTime: 1609837427000,
  177. remark: "备注、备注、备注、备注、备注、备注、备注"
  178. },
  179. {
  180. name: "财务部门",
  181. type: 3,
  182. parentId: 101,
  183. sort: 4,
  184. leaderUserId: 103,
  185. phone: "15888888888",
  186. email: "ry@qq.com",
  187. status: 1,
  188. id: 106,
  189. createTime: 1609837427000,
  190. remark: "备注、备注、备注、备注、备注、备注、备注"
  191. },
  192. {
  193. name: "运维部门",
  194. type: 3,
  195. parentId: 101,
  196. sort: 5,
  197. leaderUserId: null,
  198. phone: "15888888888",
  199. email: "ry@qq.com",
  200. status: 0,
  201. id: 107,
  202. createTime: 1609837427000,
  203. remark: "备注、备注、备注、备注、备注、备注、备注"
  204. }
  205. ]
  206. };
  207. }
  208. },
  209. {
  210. url: "/user",
  211. method: "post",
  212. response: () => {
  213. return {
  214. code: 0,
  215. data: {
  216. list: [
  217. {
  218. username: "admin",
  219. nickname: "admin",
  220. remark: "管理员",
  221. deptId: 103,
  222. postIds: [1],
  223. mobile: "15888888888",
  224. sex: 0,
  225. id: 1,
  226. status: 0,
  227. createTime: 1609837427000,
  228. dept: {
  229. id: 103,
  230. name: "研发部门"
  231. }
  232. },
  233. {
  234. username: "pure",
  235. nickname: "pure",
  236. remark: "不要吓我",
  237. deptId: 104,
  238. postIds: [1],
  239. mobile: "15888888888",
  240. sex: 0,
  241. id: 100,
  242. status: 1,
  243. createTime: 1609981637000,
  244. dept: {
  245. id: 104,
  246. name: "市场部门"
  247. }
  248. },
  249. {
  250. username: "小姐姐",
  251. nickname: "girl",
  252. remark: null,
  253. deptId: 106,
  254. postIds: null,
  255. mobile: "15888888888",
  256. sex: 1,
  257. id: 103,
  258. status: 1,
  259. createTime: 1610553035000,
  260. dept: {
  261. id: 106,
  262. name: "财务部门"
  263. }
  264. },
  265. {
  266. username: "小哥哥",
  267. nickname: "boy",
  268. remark: null,
  269. deptId: 107,
  270. postIds: [],
  271. mobile: "15888888888",
  272. sex: 0,
  273. id: 104,
  274. status: 0,
  275. createTime: 1611166433000,
  276. dept: {
  277. id: 107,
  278. name: "运维部门"
  279. }
  280. }
  281. ],
  282. total: 4
  283. }
  284. };
  285. }
  286. }
  287. ] as MockMethod[];