loginService.js 928 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. import request from "../../common/request"
  2. import { AUTH_PATH as prefix } from "../AppPath";
  3. import { SYS_PATH as sysPrefix } from "../AppPath";
  4. export default {
  5. getCode: function () {
  6. return request({
  7. url: prefix + "/user/getCode",
  8. method: 'get'
  9. })
  10. },
  11. login: function (data) {
  12. return request({
  13. url: prefix + "/user/login",
  14. method: 'post',
  15. data: data
  16. })
  17. },
  18. logout: function () {
  19. return request({
  20. url: prefix + "/user/logout",
  21. method: 'get'
  22. })
  23. },
  24. getPhoneCode (loginForm) {
  25. return request({
  26. url: sysPrefix + '/sys/user/getPhoneCode',
  27. method: 'get',
  28. params: {mobile: loginForm},
  29. })
  30. },
  31. savePwd: function (loginForm) {
  32. return request({
  33. url:sysPrefix + "/sys/user/saveNewPassword",
  34. method:"get",
  35. params:{mobile:loginForm.phoneNumber,code:loginForm.phoneCode,newPassword: loginForm.newPassword},
  36. })
  37. },
  38. }