auth.js 658 B

123456789101112131415161718192021222324252627282930313233
  1. import config from "@/config"
  2. import http from "@/utils/request"
  3. export default {
  4. login: {
  5. url: `${config.API_URL}/login`,
  6. name: "-",
  7. post: async function(data={}){
  8. return await http.post(this.url, data);
  9. }
  10. },
  11. mobile: {
  12. url: `${config.API_URL}/login/mobile`,
  13. name: "-",
  14. post: async function(data={}){
  15. return await http.post(this.url, data);
  16. }
  17. },
  18. sms: {
  19. url: `${config.API_URL}/login/sms`,
  20. name: "-",
  21. post: async function(data={}){
  22. return await http.post(this.url, data);
  23. }
  24. },
  25. user: {
  26. url: `${config.API_URL}/profile`,
  27. name: "-",
  28. get: async function(data={}){
  29. return await http.get(this.url, data);
  30. }
  31. },
  32. }