diff --git a/src/services/authenticationService.js b/src/services/authenticationService.js index 58f78bb..36a7db4 100644 --- a/src/services/authenticationService.js +++ b/src/services/authenticationService.js @@ -2,11 +2,19 @@ import axios from "axios"; export default { login(username, password, apiUrl="http://localhost:8080"){ - return axios.get(`/checkLogin`, {username:username, password:password}) + const url = `${apiUrl}/users/checkLogin` + const data = { + username: username, + password: password + }; + return axios.post(url, data) .then(response => { - alert("hahaha"); - // 处理登录成功的逻辑 + alert(">login方法中<"); + alert(response.data); return response.data; }); + }, + register(){ + //跳转逻辑 } } \ No newline at end of file diff --git a/src/views/authentication.vue b/src/views/authentication.vue index 2c3a3b1..726e27f 100644 --- a/src/views/authentication.vue +++ b/src/views/authentication.vue @@ -7,6 +7,7 @@ LOGIN + REGISTER