login.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. headers: {
  13. isToken: false,
  14. repeatSubmit: false
  15. },
  16. method: 'post',
  17. data: data
  18. })
  19. }
  20. // 登录方法
  21. export function loginSso() {
  22. return request({
  23. url: '/api/loginSso',
  24. headers: {
  25. isToken: false,
  26. repeatSubmit: false
  27. },
  28. method: 'post'
  29. })
  30. }
  31. // 注册方法
  32. export function register(data) {
  33. return request({
  34. url: '/register',
  35. headers: {
  36. isToken: false
  37. },
  38. method: 'post',
  39. data: data
  40. })
  41. }
  42. // 获取用户详细信息
  43. export function getInfo() {
  44. return request({
  45. url: '/api/userInfo',
  46. method: 'post'
  47. })
  48. }
  49. // 退出方法
  50. export function logout() {
  51. return request({
  52. url: '/logout',
  53. method: 'post'
  54. })
  55. }
  56. // 获取验证码
  57. export function getCodeImg() {
  58. return request({
  59. url: '/captchaImage',
  60. headers: {
  61. isToken: false
  62. },
  63. method: 'get',
  64. timeout: 20000
  65. })
  66. }