feat: Zod를 사용한 월드 상태 구성 및 메타 타입 추가, 사용자 ID 처리 개선
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user