feat(web): role-aware UI (badge, selector, toggle button, hide admin-only sections for members)

This commit is contained in:
saopig1 committed 2026-05-27 15:38:42 +08:00
1 parent a73f797bcb
commit 780726a4e3
3 files changed
+78 -9

No files matched your search

+2
View File
@@ -3,6 +3,7 @@ import { ref, computed, readonly } from "vue";
interface User {
id: string;
username: string;
role: 'admin' | 'member';
}
const currentUser = ref<User | null>(null);
@@ -75,6 +76,7 @@ export function useSession() {
currentUser: readonly(currentUser),
needsSetup: readonly(needsSetup),
isAuthenticated: computed(() => currentUser.value !== null),
isAdmin: computed(() => currentUser.value?.role === 'admin'),
ready: readonly(ready),
refresh,
login,