feat(web): prompt-templates view + chat/admin routes + nav + isAdmin guard

This commit is contained in:
2026-05-04 20:15:49 +08:00
parent 372af06b01
commit ff283013da
4 changed files with 284 additions and 1 deletions
+2 -1
View File
@@ -53,6 +53,7 @@ export const useAuthStore = defineStore('auth', () => {
const user = ref<User | null>(safeReadJSON<User | null>('user', null))
const isAuthenticated = computed(() => !!token.value)
const isAdmin = computed(() => !!user.value?.is_admin)
function setSession(t: string, u: User) {
token.value = t
@@ -68,5 +69,5 @@ export const useAuthStore = defineStore('auth', () => {
safeRemove('user')
}
return { token, user, isAuthenticated, setSession, clearSession }
return { token, user, isAuthenticated, isAdmin, setSession, clearSession }
})