login.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. tenantId: '0',
  10. clientId: 'e5cd7e4891bf95d1d19206ce24a7b32e',
  11. grantType: 'password'
  12. }
  13. return request({
  14. 'url': '/auth/login',
  15. headers: {
  16. isToken: false,
  17. isClientId:true,
  18. isEncrypt:true,
  19. },
  20. 'method': 'post',
  21. 'data': data,
  22. })
  23. }
  24. // 注册方法
  25. export function register(data) {
  26. return request({
  27. url: '/register',
  28. headers: {
  29. isToken: false
  30. },
  31. method: 'post',
  32. data: data
  33. })
  34. }
  35. // 获取用户详细信息
  36. export function getInfo() {
  37. return request({
  38. 'url': '/system/user/getInfo',
  39. headers: {
  40. isClientId:true,
  41. },
  42. 'method': 'get'
  43. })
  44. }
  45. // 退出方法
  46. export function logout() {
  47. return request({
  48. 'url': '/auth/logout',
  49. 'method': 'post'
  50. })
  51. }
  52. // 获取验证码
  53. export function getCodeImg() {
  54. return request({
  55. 'url': '/captchaImage',
  56. headers: {
  57. isToken: false,
  58. },
  59. method: 'get',
  60. timeout: 20000
  61. })
  62. }