login.js 438 B

1234567891011121314151617181920212223242526272829
  1. import fetch from '@/utils/fetch';
  2. export function loginByEmail(email, password) {
  3. const data = {
  4. email,
  5. password
  6. };
  7. return fetch({
  8. url: '/login/loginbyemail',
  9. method: 'post',
  10. data
  11. });
  12. }
  13. export function logout() {
  14. return fetch({
  15. url: '/login/logout',
  16. method: 'post'
  17. });
  18. }
  19. export function getInfo(token) {
  20. return fetch({
  21. url: '/user/info',
  22. method: 'get',
  23. params: { token }
  24. });
  25. }