login.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. import request from '@/utils/request'
  2. // 登录方法
  3. export function login(username, password, code, uuid) {
  4. const data = {
  5. username,
  6. password,
  7. code,
  8. uuid
  9. }
  10. return request({
  11. url: '/login',
  12. method: 'post',
  13. data: data
  14. })
  15. }
  16. // 注册方法
  17. export function register(data) {
  18. return request({
  19. url: '/register',
  20. headers: {
  21. isToken: false
  22. },
  23. method: 'post',
  24. data: data
  25. })
  26. }
  27. // 获取用户详细信息
  28. export function getInfo() {
  29. return request({
  30. url: '/getInfo',
  31. method: 'get'
  32. })
  33. }
  34. // 退出方法
  35. export function logout() {
  36. return request({
  37. url: '/logout',
  38. method: 'post'
  39. })
  40. }
  41. // 获取验证码
  42. export function getCodeImg() {
  43. return request({
  44. url: '/captchaImage',
  45. method: 'get',
  46. timeout: 20000
  47. })
  48. }
  49. export function getWechatQrCode(data) {
  50. return request({
  51. url: '/getWechatQrCode',
  52. method: 'post',
  53. data: data
  54. })
  55. }
  56. export function checkWechatScan(ticket) {
  57. return request({
  58. url: '/checkWechatScan',
  59. method: 'get',
  60. params: { ticket }
  61. })
  62. }
  63. export function checkIsNeedCheck(username, password, code, uuid) {
  64. const data = {
  65. username,
  66. password,
  67. code,
  68. uuid
  69. }
  70. return request({
  71. url: '/checkIsNeedCheck',
  72. method: 'post',
  73. data: data
  74. })
  75. }