From b613331464d0ecc10dd22c30d8974273df577178 Mon Sep 17 00:00:00 2001
From: MiLla <18826902282@163.com>
Date: Tue, 25 Jun 2024 16:22:01 +0800
Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=BD=95=E6=B2=A1=E9=97=AE=E9=A2=98?=
=?UTF-8?q?=E4=BA=86=EF=BC=8C=E6=AD=A3=E5=9C=A8=E5=86=99=E6=B3=A8=E5=86=8C?=
=?UTF-8?q?=EF=BC=8C=E4=BD=86=E4=BC=BC=E4=B9=8E=E8=A6=81=E7=94=A8ref?=
=?UTF-8?q?=E4=B9=8B=E7=B1=BB=E7=9A=84=E4=B8=9C=E8=A5=BF=EF=BC=8C=E8=BF=99?=
=?UTF-8?q?=E4=B8=AA=E7=89=88=E6=9C=AC=E6=98=AF=E6=B2=A1=E6=9C=89=E7=9A=84?=
=?UTF-8?q?=EF=BC=8C=E4=B9=8B=E5=90=8E=E5=B0=9D=E8=AF=95=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/App.vue | 2 +-
src/router/authentication.js | 2 +-
src/router/index.js | 2 +-
src/services/authenticationService.js | 15 +++++-
...ntication.vue => authentication_login.vue} | 5 +-
src/views/authentication_register.vue | 51 +++++++++++++++++++
6 files changed, 70 insertions(+), 7 deletions(-)
rename src/views/{authentication.vue => authentication_login.vue} (92%)
create mode 100644 src/views/authentication_register.vue
diff --git a/src/App.vue b/src/App.vue
index 32af3d5..bc687ea 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -1,6 +1,6 @@
diff --git a/src/router/authentication.js b/src/router/authentication.js
index 5fcc93d..5bf05ef 100644
--- a/src/router/authentication.js
+++ b/src/router/authentication.js
@@ -1,4 +1,4 @@
-import authentication from '../views/authentication.vue'
+import authentication from '../views/authentication_login.vue'
export default [
{ path: '/login', component: authentication },
diff --git a/src/router/index.js b/src/router/index.js
index e8d32ad..d6483bb 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -6,7 +6,7 @@ import meetingManagementRoutes from './meetingManagement'
import newsManagementRoutes from './newsManagement'
import organizationManagementRoutes from './organizationManagement'
import userManagementRoutes from './userManagement'
-import authentication from "../views/authentication.vue";
+import authentication from "../views/authentication_login.vue";
const routes = [
{ path: '/', component: HelloWorld },
diff --git a/src/services/authenticationService.js b/src/services/authenticationService.js
index 36a7db4..c1025e9 100644
--- a/src/services/authenticationService.js
+++ b/src/services/authenticationService.js
@@ -10,11 +10,22 @@ export default {
return axios.post(url, data)
.then(response => {
alert(">login方法中<");
- alert(response.data);
+ alert(response.data.username);
return response.data;
});
},
- register(){
+ register(user){
+ const url = `${apiUrl}/users/checkLogin`
+ const data = {
+ username: username,
+ password: password
+ };
+ return axios.post(url, data)
+ .then(response => {
+ alert(">login方法中<");
+ alert(response.data.username);
+ return response.data;
+ });
//跳转逻辑
}
}
\ No newline at end of file
diff --git a/src/views/authentication.vue b/src/views/authentication_login.vue
similarity index 92%
rename from src/views/authentication.vue
rename to src/views/authentication_login.vue
index 726e27f..3c51846 100644
--- a/src/views/authentication.vue
+++ b/src/views/authentication_login.vue
@@ -23,8 +23,9 @@
},methods:{
handleLogin(){
authenticationService.login(this.username,this.password).then(res=>{
- alert("login方法调用完毕");
- alert(res.data);
+ alert(res.username);
+ alert("login方法调用完毕");
+
});
},handleRegister(){
authenticationService.register(this.username,this.password).then(res=>{
diff --git a/src/views/authentication_register.vue b/src/views/authentication_register.vue
new file mode 100644
index 0000000..5617421
--- /dev/null
+++ b/src/views/authentication_register.vue
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+
+
+
+
+
+ BACK
+ REGISTER
+
+
+
+
\ No newline at end of file