[feat] negodata/front: 프론트 초기 구축 (Vite+React, orval API 클라이언트, 견적/상품/협력사 페이지)
- 라우팅 react-router v7, 서버상태 TanStack Query - orval 자동 생성 API 클라이언트(src/api/generated) - 견적/상품/협력사/견적설정 페이지, shadcn UI, 토큰(tokens.css) - 실행: 루트 docker compose (front :3001), README 그에 맞게 정리 - AI Studio 스캐폴드 잔재 제거(metadata.json, 중복 DESIGN_TOKENS.md), 타이틀 NegoData, vite.config 죽은코드 제거 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
a6731dcb07
commit
87524bf6e8
288 files changed
+26363
-1
No files matched your search
@@ -0,0 +1,28 @@
|
||||
import {create} from 'zustand';
|
||||
|
||||
export type UserRole = '매니져' | '일반';
|
||||
|
||||
export interface AuthUser {
|
||||
company: string;
|
||||
name: string;
|
||||
loginId: string;
|
||||
email: string;
|
||||
contact: string;
|
||||
role: UserRole;
|
||||
}
|
||||
|
||||
interface AuthStore {
|
||||
user: AuthUser | null;
|
||||
setUser: (user: AuthUser | null) => void;
|
||||
}
|
||||
|
||||
export const useAuthStore = create<AuthStore>((set) => ({
|
||||
user: null,
|
||||
setUser: (user) => set({user}),
|
||||
}));
|
||||
|
||||
export const isLoggedIn = () => useAuthStore.getState().user !== null;
|
||||
export const hasRole = (...roles: UserRole[]) => {
|
||||
const u = useAuthStore.getState().user;
|
||||
return u ? roles.includes(u.role) : false;
|
||||
};
|
||||
Reference in new issue
Block a user