count is {{ count }}
@@ -25,19 +25,24 @@ const count = ref(0)
Check out
- create-vue, the official Vue + Vite starter
+ create-vue, the official Vue + Vite starter
Learn more about IDE Support for Vue in the
- Vue Docs Scaling up Guide.
+ Vue Docs Scaling up Guide.
Click on the Vite and Vue logos to learn more
+
+
+
+ - Login
+ - Register
+ - Courses
+ - Meetings
+ - News
+ - Organizations
+ - Users
+
+
\ No newline at end of file
diff --git a/src/router/authentication.js b/src/router/authentication.js
index 7c0f2e7..b04a1e6 100644
--- a/src/router/authentication.js
+++ b/src/router/authentication.js
@@ -1,10 +1,23 @@
-// !!!这是一个示例,请根据实际情况修改!!!
-// import Login from '../views/authentication/Login.vue'
-// import Register from '../views/authentication/Register.vue'
-// import Profile from '../views/authentication/Profile.vue'
+// authentication.js
+import Login from '../views/authentication/Login.vue';
+import Register from '../views/authentication/Register.vue';
+import Profile from '../views/authentication/Profile.vue';
export default [
- // { path: '/login', component: Login },
- // { path: '/register', component: Register },
- // { path: '/profile', component: Profile }
-]
+ {
+ path: '/login',
+ name: 'Login',
+ component: Login
+ },
+ {
+ path: '/register',
+ name: 'Register',
+ component: Register
+ },
+ {
+ path: '/profile',
+ // path: '/profile/:userId',
+ name: 'Profile',
+ component: Profile
+ }
+];
\ No newline at end of file
diff --git a/src/services/authenticationService.js b/src/services/authenticationService.js
index e69de29..001fae7 100644
--- a/src/services/authenticationService.js
+++ b/src/services/authenticationService.js
@@ -0,0 +1,34 @@
+// authenticationService.js
+import axios from 'axios';
+
+const API_URL = '/api';
+
+class AuthenticationService {
+ login(credentials) {
+ return axios.post(`${API_URL}/login`, credentials);
+ }
+
+ register(user) {
+ return axios.post(`${API_URL}/register`, user);
+ }
+
+ updateUserInfo(user) {
+ return axios.post(`${API_URL}/update`, user);
+ }
+
+ changePassword(data) {
+ return axios.post(`${API_URL}/changePassword`, null, {
+ params: {
+ username: data.username,
+ oldPassword: data.oldPassword,
+ newPassword: data.newPassword
+ }
+ });
+ }
+
+ getUserInfo(token) {
+ return axios.get(`${API_URL}/profile?token=${token}`);
+ }
+}
+
+export default new AuthenticationService();
\ No newline at end of file
diff --git a/src/store/authentication.js b/src/store/authentication.js
index 77ff04e..7e79daf 100644
--- a/src/store/authentication.js
+++ b/src/store/authentication.js
@@ -1,24 +1,25 @@
const state = {
- user: null
+ token: null
}
const mutations = {
- setUser(state, user) {
- state.user = user
+ setUser(state, {token}) {
+ state.token = token
}
}
const actions = {
- login({ commit }, user) {
- commit('setUser', user)
+ login({commit}, token) {
+ commit('setUser', token)
},
- logout({ commit }) {
+ logout({commit}) {
commit('setUser', null)
}
}
const getters = {
- isAuthenticated: state => !!state.user
+ isAuthenticated: state => !!state.token,
+ token: state => state.token
}
export default {
diff --git a/src/views/authentication/Login.vue b/src/views/authentication/Login.vue
new file mode 100644
index 0000000..3868819
--- /dev/null
+++ b/src/views/authentication/Login.vue
@@ -0,0 +1,73 @@
+
+
+
+
+
+
Login
+
+
+
+
+
+
+
+
+ Login
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/views/authentication/Profile.vue b/src/views/authentication/Profile.vue
new file mode 100644
index 0000000..77350b3
--- /dev/null
+++ b/src/views/authentication/Profile.vue
@@ -0,0 +1,189 @@
+
+
+
+
+
+
+
+
+
+
+
User Information
+
+
+
Username: {{ user.username }}
+
Email: {{ user.email }}
+
Phone Number: {{ user.phoneNumber }}
+
Company: {{ user.company }}
+
Created Date: {{ user.createdDate }}
+
+
+

+
+
+
+
+
+
Profile
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Update Profile
+
+
+
+
+
+
Change Password
+
+
+
+
+
+
+
+
+
+
+
+ Change Password
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/views/authentication/Register.vue b/src/views/authentication/Register.vue
new file mode 100644
index 0000000..2487f46
--- /dev/null
+++ b/src/views/authentication/Register.vue
@@ -0,0 +1,84 @@
+
+
+
Register
+
+
{{ message }}
+
+
+
+
\ No newline at end of file
diff --git a/src/views/user-management/Profile.vue b/src/views/user-management/Profile.vue
new file mode 100644
index 0000000..2fb1d7b
--- /dev/null
+++ b/src/views/user-management/Profile.vue
@@ -0,0 +1,56 @@
+
+
+
+
+
\ No newline at end of file