frontend/src/services/authenticationService.js

24 lines
644 B
JavaScript
Raw Normal View History

import axios from "axios";
export default {
login(account, password){
const url = `http://localhost:8080/users/checkLogin`
const data = {
account: account,
password: password
};
return axios.post(url, data)
.then(response => {
alert(response.data.account);
return response.data;
});
},
register(user){
const url = `http://localhost:8080/users/checkRegister`
return axios.post(url, user)
.then(response => {
return response.data;
});
//跳转逻辑
}
}