feat(TopBar): add user settings & logout btn and finish logout function

refactor(auth): rename login-token to token for consistency

Update all token references from 'login-token' to 'token' across the application. Also enhance TopBar with user menu functionality including logout and settings options.

- Standardize token cookie name for better maintainability
- Add dropdown menu to TopBar with logout functionality
- Implement click-outside behavior for menu
- Improve TopBar styling and user interaction
This commit is contained in:
2026-03-10 19:05:56 +08:00
parent 491c74e231
commit f103858fe0
4 changed files with 120 additions and 10 deletions

View File

@@ -112,7 +112,7 @@ export default {
};
const handleLoginSuccess = (result) => {
setCookie('login-token', result.data.token);
setCookie('token', result.data.token);
setCookie('user-id', result.data.userID);
setCookie('username', result.data.username);
setCookie('user-type', result.data.type);