24 lines
644 B
JavaScript
24 lines
644 B
JavaScript
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;
|
|
});
|
|
//跳转逻辑
|
|
}
|
|
} |