From dcc2d06c8fd1c3587ad8ce6bd946079c45e40970 Mon Sep 17 00:00:00 2001 From: NanamiAdmin Date: Tue, 31 Mar 2026 21:52:31 +0800 Subject: [PATCH] feat(user-settings): add user settings modal with username and password update Implement user settings functionality in TopBar component with a modal dialog that allows users to update their username and password. The modal includes form validation and error handling, with proper password confirmation checks. --- src/api/index.js | 2 + src/components/TopBar.vue | 213 ++++++++++++++++++++++++++++++++++++-- 2 files changed, 207 insertions(+), 8 deletions(-) diff --git a/src/api/index.js b/src/api/index.js index db90ec3..b63daf4 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -52,6 +52,8 @@ export const userApi = { api.post('/userMgr/remove', { targetUserID }), listUsers: () => api.get('/userMgr/list'), + modifyUser: (userID, username, passwd) => + api.post(`/userMgr/modify`, { userID, username, passwd }), modifyType: (userID, newType) => api.post(`/userMgr/modifyType`, { userID, newType: newType.toLowerCase() || 'visitor' }) }; diff --git a/src/components/TopBar.vue b/src/components/TopBar.vue index feec830..0f0ad53 100644 --- a/src/components/TopBar.vue +++ b/src/components/TopBar.vue @@ -28,7 +28,7 @@ {{ username }}
- @@ -38,14 +38,49 @@
+