login.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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 getInfo() {
  18. return request({
  19. url: '/getInfo',
  20. method: 'get'
  21. })
  22. }
  23. // 退出方法
  24. export function logout() {
  25. return request({
  26. url: '/logout',
  27. method: 'post'
  28. })
  29. }
  30. // 获取验证码
  31. export function getCodeImg() {
  32. return request({
  33. url: '/captchaImage',
  34. method: 'get'
  35. })
  36. }
  37. // 判定是否首次登录
  38. export function getFirstLogin() {
  39. return request({
  40. url: '/getFirstLogin',
  41. method: 'get'
  42. })
  43. }
  44. export function getWechatQrCode(data) {
  45. return request({
  46. url: '/getWechatQrCode',
  47. method: 'post',
  48. data: data
  49. })
  50. }
  51. export function checkWechatScan(ticket) {
  52. return request({
  53. url: '/checkWechatScan',
  54. method: 'get',
  55. params: { ticket }
  56. })
  57. }
  58. //检查是否需要验证码验证
  59. export function checkIsNeedCheck(username, password, code, uuid) {
  60. const data = {
  61. username,
  62. password,
  63. code,
  64. uuid
  65. }
  66. return request({
  67. url: '/checkIsNeedCheck',
  68. method: 'post',
  69. data: data
  70. })
  71. }