feat: Zod를 사용한 월드 상태 구성 및 메타 타입 추가, 사용자 ID 처리 개선

This commit is contained in:
2026-01-05 14:49:19 +00:00
parent 4391110ab0
commit 1861cbc9c6
17 changed files with 118 additions and 153 deletions
+9 -2
View File
@@ -1,11 +1,18 @@
import { defineStore } from 'pinia';
import { ref } from 'vue';
export interface UserInfo {
id: string;
username: string;
displayName: string;
roles: string[];
}
export const useAuthStore = defineStore('auth', () => {
const user = ref(null);
const user = ref<UserInfo | null>(null);
const isLoggedIn = ref(false);
function setUser(userData: any) {
function setUser(userData: UserInfo | null) {
user.value = userData;
isLoggedIn.value = !!userData;
}