user.ts 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. import { handle } from '../../index'
  2. const suffix = 'api'
  3. // 验证码
  4. export const captcha = () => handle({
  5. url: `/${suffix}/captcha`,
  6. method: 'get',
  7. })
  8. // 登录
  9. export const login = (params: any) => handle({
  10. url: `/${suffix}/login`,
  11. method: 'post',
  12. params
  13. })
  14. // 验证码
  15. export const getCurrentUser = () => handle({
  16. url: `/${suffix}/getCurrentUser`,
  17. method: 'get',
  18. })
  19. // 分页列表
  20. export const usersGetPageUser = (params: any) => handle({
  21. url: `/${suffix}/users/getPageUser`,
  22. method: 'get',
  23. params
  24. })
  25. // 详情
  26. export const usersGetUserById = (id: any) => handle({
  27. url: `/${suffix}/users/getUserById/${id}`,
  28. method: 'get',
  29. })
  30. // 新增
  31. export const usersRegister = (params: any) => handle({
  32. url: `/${suffix}/users/register`,
  33. method: 'post',
  34. params
  35. })
  36. // 编辑
  37. export const usersUpdate = (params: any) => handle({
  38. url: `/${suffix}/users/update`,
  39. method: 'post',
  40. params
  41. })
  42. // 修改密码
  43. export const usersUpdatePassword = (params: any) => handle({
  44. url: `/${suffix}/users/updatePassword`,
  45. method: 'post',
  46. params
  47. })
  48. // 删除
  49. export const usersDeleteUser = (id: any) => handle({
  50. url: `/${suffix}/users/deleteUser/${id}`,
  51. method: 'get',
  52. })
  53. // 查看授权
  54. export const usersGetAuthorization = (id: any) => handle({
  55. url: `/${suffix}/users/getAuthorization/${id}`,
  56. method: 'get',
  57. })
  58. // 授权
  59. export const usersDoAuthorization = (params: any) => handle({
  60. url: `/${suffix}/users/doAuthorization`,
  61. method: 'post',
  62. params
  63. })