user.js 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. import service from '@/utils/request'
  2. // @Summary 用户登录
  3. // @Produce application/json
  4. // @Param data body {username:"string",password:"string"}
  5. // @Router /base/login [post]
  6. export const login = (data) => {
  7. return service({
  8. url: "/admin/login",
  9. method: 'post',
  10. data: data
  11. })
  12. }
  13. // @Summary 获取验证码
  14. // @Produce application/json
  15. // @Param data body {username:"string",password:"string"}
  16. // @Router /base/captcha [post]
  17. export const captcha = (data) => {
  18. return service({
  19. url: "/admin/captcha",
  20. method: 'post',
  21. data: data
  22. })
  23. }
  24. // @Summary 用户注册
  25. // @Produce application/json
  26. // @Param data body {username:"string",password:"string"}
  27. // @Router /base/resige [post]
  28. export const register = (data) => {
  29. return service({
  30. url: "/user/register",
  31. method: 'post',
  32. data: data
  33. })
  34. }
  35. // @Summary 修改密码
  36. // @Produce application/json
  37. // @Param data body {username:"string",password:"string",newPassword:"string"}
  38. // @Router /user/changePassword [post]
  39. export const changePassword = (data) => {
  40. return service({
  41. url: "/user/changePassword",
  42. method: 'post',
  43. data: data
  44. })
  45. }
  46. // @Tags User
  47. // @Summary 分页获取用户列表
  48. // @Security ApiKeyAuth
  49. // @accept application/json
  50. // @Produce application/json
  51. // @Param data body modelInterface.PageInfo true "分页获取用户列表"
  52. // @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
  53. // @Router /user/getUserList [post]
  54. export const getUserList = (data) => {
  55. return service({
  56. url: "/user/getUserList",
  57. method: 'post',
  58. data: data
  59. })
  60. }
  61. // @Tags User
  62. // @Summary 设置用户权限
  63. // @Security ApiKeyAuth
  64. // @accept application/json
  65. // @Produce application/json
  66. // @Param data body api.SetUserAuth true "设置用户权限"
  67. // @Success 200 {string} json "{"success":true,"data":{},"msg":"修改成功"}"
  68. // @Router /user/setUserAuthority [post]
  69. export const setUserAuthority = (data) => {
  70. return service({
  71. url: "/user/setUserAuthority",
  72. method: 'post',
  73. data: data
  74. })
  75. }
  76. // @Tags SysUser
  77. // @Summary 删除用户
  78. // @Security ApiKeyAuth
  79. // @accept application/json
  80. // @Produce application/json
  81. // @Param data body request.SetUserAuth true "删除用户"
  82. // @Success 200 {string} string "{"success":true,"data":{},"msg":"修改成功"}"
  83. // @Router /user/deleteUser [delete]
  84. export const deleteUser = (data) => {
  85. return service({
  86. url: "/user/deleteUser",
  87. method: 'delete',
  88. data: data
  89. })
  90. }
  91. // @Tags SysUser
  92. // @Summary 设置用户信息
  93. // @Security ApiKeyAuth
  94. // @accept application/json
  95. // @Produce application/json
  96. // @Param data body model.SysUser true "设置用户信息"
  97. // @Success 200 {string} string "{"success":true,"data":{},"msg":"修改成功"}"
  98. // @Router /user/setUserInfo [put]
  99. export const setUserInfo = (data) => {
  100. return service({
  101. url: "/user/setUserInfo",
  102. method: 'put',
  103. data: data
  104. })
  105. }
  106. export const getYyqUserList = (data) => {
  107. return service({
  108. url: "/user/getYyqUserList",
  109. method: 'post',
  110. data: data
  111. })
  112. }
  113. export const deleteYyqUser = (data) => {
  114. return service({
  115. url: "/user/deleteYyqUser",
  116. method: 'post',
  117. data: data
  118. })
  119. }
  120. export const createYyqUser = (data) => {
  121. return service({
  122. url: "/user/createYyqUser",
  123. method: 'post',
  124. data: data
  125. })
  126. }