user.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. import request from '@/utils/request'
  2. export function login(data) { //常规
  3. return request({
  4. url: `/sys/login`,
  5. method: 'post',
  6. params: data
  7. })
  8. }
  9. // 登录方法(ERP)
  10. export function loginERP(data) {
  11. return request({
  12. url: '/sys/loginByCenter',
  13. method: 'post',
  14. data
  15. })
  16. }
  17. // 获取权限菜单栏
  18. export function getInfo() {
  19. return request({
  20. url: '/sys/getRouters',
  21. method: 'get',
  22. })
  23. }
  24. // 获取权限菜单栏
  25. export function getInfo2() {
  26. return request({
  27. url: '/sys/getInfo/',
  28. method: 'get',
  29. })
  30. }
  31. // /system/user /
  32. // export function getInfo(data) {
  33. // return request({
  34. // url: '/menu/queryMenu',
  35. // method: 'post',
  36. // data
  37. // })
  38. // }
  39. export function logout() { //用户退出
  40. return request({
  41. url: '/sys/loginOut',
  42. method: 'post',
  43. })
  44. }
  45. // 获取验证码
  46. export function getCodeImg(query) { //captchaImage/ 后面的参数跟captchaType = math(生成需要计算的验证码)char(生成文字二维码)
  47. return request({
  48. url: '/captchaImage?captchaType=math&',
  49. method: 'get',
  50. params: query
  51. })
  52. }