user.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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: "/base/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/resige [post]
  17. export const regist = (data) => {
  18. return service({
  19. url: "/base/regist",
  20. method: 'post',
  21. data: data
  22. })
  23. }
  24. // @Tags User
  25. // @Summary 分页获取用户列表
  26. // @Security ApiKeyAuth
  27. // @accept application/json
  28. // @Produce application/json
  29. // @Param data body modelInterface.PageInfo true "分页获取用户列表"
  30. // @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
  31. // @Router /user/getUserList [post]
  32. export const getUserList = (data) => {
  33. return service({
  34. url: "/user/getUserList",
  35. method: 'post',
  36. data: data
  37. })
  38. }
  39. // @Tags User
  40. // @Summary 设置用户权限
  41. // @Security ApiKeyAuth
  42. // @accept application/json
  43. // @Produce application/json
  44. // @Param data body api.SetUserAuth true "设置用户权限"
  45. // @Success 200 {string} json "{"success":true,"data":{},"msg":"修改成功"}"
  46. // @Router /user/setUserAuthority [post]
  47. export const setUserAuthority = (data) => {
  48. return service({
  49. url: "/user/setUserAuthority",
  50. method: 'post',
  51. data: data
  52. })
  53. }