login.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. }
  49. // 获取手机验证码
  50. export function getSendVerificationCode(data) {
  51. return request({
  52. url: '/system/app/sendVerificationCode',
  53. headers: {
  54. isToken: false
  55. },
  56. data,
  57. method: 'post',
  58. timeout: 20000
  59. })
  60. }
  61. export function phoneLogin(data) {
  62. return request({
  63. url: '/system/app/register',
  64. headers: {
  65. isToken: false
  66. },
  67. method: 'post',
  68. data: data
  69. })
  70. }