mirror of
https://github.com/ZHANGTIANYAO1/teamspeak-music-bot.git
synced 2026-10-01 20:42:50 +08:00
feat(web): role-aware UI (badge, selector, toggle button, hide admin-only sections for members)
This commit is contained in:
1 parent
a73f797bcb
commit
780726a4e3
3 files changed
+78
-9
No files matched your search
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user