From 14522088223990dd99030ef8379d4100de5c324e Mon Sep 17 00:00:00 2001
From: MiLla <18826902282@163.com>
Date: Tue, 25 Jun 2024 14:54:39 +0800
Subject: [PATCH] =?UTF-8?q?=E8=BF=98=E6=98=AF=E6=9C=89=E9=97=AE=E9=A2=98?=
=?UTF-8?q?=EF=BC=8C=E4=B8=8D=E8=BF=87=E7=8E=B0=E5=9C=A8=E5=90=8E=E7=AB=AF?=
=?UTF-8?q?=E5=8F=AF=E4=BB=A5=E6=AD=A3=E5=B8=B8=E6=94=B6=E5=88=B0username?=
=?UTF-8?q?=E5=92=8Cpassword?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/services/authenticationService.js | 14 +++++++++++---
src/views/authentication.vue | 8 +++++++-
2 files changed, 18 insertions(+), 4 deletions(-)
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