frontend/src/services/authenticationService.js

20 lines
511 B
JavaScript
Raw Normal View History

import axios from "axios";
export default {
login(username, password, apiUrl="http://localhost:8080"){
const url = `${apiUrl}/users/checkLogin`
const data = {
username: username,
password: password
};
return axios.post(url, data)
.then(response => {
alert(">login方法中<");
alert(response.data);
return response.data;
});
},
register(){
//跳转逻辑
}
}