user.js 641 B

1234567891011121314151617181920212223242526272829303132
  1. import { axios } from '@/utils/request'
  2. const api = {
  3. userPre: 'api/user'
  4. }
  5. export function loginAPI(data){
  6. return axios({
  7. url:`${api.userPre}/login`,
  8. method: 'POST',
  9. data
  10. })
  11. }
  12. export function registerAPI(data){
  13. return axios({
  14. url: `${api.userPre}/register`,
  15. method: 'POST',
  16. data
  17. })
  18. }
  19. export function getUserInfoAPI(){
  20. return axios({
  21. url: `${api.userPre}/getUserInfo`,
  22. method: 'GET'
  23. })
  24. }
  25. export function updateUserInfoByIdAPI(data) {
  26. return axios({
  27. url: `${api.userPre}/updateUserInfoById`,
  28. method: 'POST',
  29. data
  30. })
  31. }