login.js 880 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. import request from '@/utils/request'
  2. // 登录方法
  3. export function login(data) {
  4. return request({
  5. url: '/system/app/loginByAccount',
  6. headers: {
  7. isToken: false
  8. },
  9. method: 'post',
  10. data: data
  11. })
  12. }
  13. // 注册方法
  14. export function register(data) {
  15. return request({
  16. url: '/system/app/account',
  17. headers: {
  18. isToken: false
  19. },
  20. method: 'post',
  21. data: data
  22. })
  23. }
  24. // 获取用户详细信息
  25. export function getInfo() {
  26. return request({
  27. url: '/getInfo',
  28. method: 'get'
  29. })
  30. }
  31. // 退出方法
  32. export function logout() {
  33. return request({
  34. url: '/logout',
  35. method: 'post'
  36. })
  37. }
  38. // 获取验证码
  39. export function getCodeImg() {
  40. return request({
  41. url: '/captchaImage',
  42. headers: {
  43. isToken: false
  44. },
  45. method: 'get',
  46. timeout: 20000
  47. })
  48. }