login.js 1.4 KB

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