login.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /** @format */
  2. import request from "@/utils/request";
  3. // 登录方法
  4. export function login(username, password, code, uuid) {
  5. const data = {
  6. username,
  7. password,
  8. code,
  9. uuid,
  10. };
  11. return request({
  12. url: "/api/miuser/login",
  13. headers: {
  14. isToken: false,
  15. },
  16. method: "post",
  17. data: data,
  18. });
  19. }
  20. // 注册方法
  21. export function register(data) {
  22. return request({
  23. url: "/register",
  24. headers: {
  25. isToken: false,
  26. },
  27. method: "post",
  28. data: data,
  29. });
  30. }
  31. // 获取用户详细信息
  32. export function getInfo() {
  33. return request({
  34. url: "/api/miuser/userInfo",
  35. method: "get",
  36. });
  37. }
  38. // 退出方法
  39. export function logout() {
  40. return request({
  41. url: "/logout",
  42. method: "post",
  43. });
  44. }
  45. // 获取验证码
  46. export function getCodeImg() {
  47. return request({
  48. url: "/captchaImage",
  49. headers: {
  50. isToken: false,
  51. },
  52. method: "get",
  53. timeout: 20000,
  54. });
  55. }
  56. //获取字典
  57. export function getDictConfig(params) {
  58. return request({
  59. url: "/api/common/dict-data-list",
  60. method: "get",
  61. params,
  62. });
  63. }