add easy-mock

This commit is contained in:
Pan
2017-06-26 15:43:11 +08:00
parent c528bd8ad0
commit 472cbb6d65
11 changed files with 89 additions and 156 deletions

View File

@@ -1,21 +1,13 @@
import fetch from '@/utils/fetch';
export function loginByEmail(email, password) {
const data = {
email,
password
};
export function login(email, password) {
return fetch({
url: '/login/loginbyemail',
url: '/user/login',
method: 'post',
data
});
}
export function logout() {
return fetch({
url: '/login/logout',
method: 'post'
data: {
email,
password
}
});
}
@@ -27,3 +19,12 @@ export function getInfo(token) {
});
}
export function logout() {
return fetch({
url: '/user/logout',
method: 'post'
});
}