refactor: 로딩 스피너 표준화 및 프로젝트 헬스 개선

- LoadingSpinner 컴포넌트 5가지 변형 구현
  - LoadingSpinner (인라인/버튼용)
  - ContentLoadingSpinner (상세/수정 페이지)
  - PageLoadingSpinner (페이지 전환)
  - TableLoadingSpinner (테이블/리스트)
  - ButtonSpinner (버튼 내부)
- 18개+ 페이지 로딩 UI 표준화
  - HR 페이지 (사원, 휴가, 부서, 급여, 근태)
  - 영업 페이지 (견적, 거래처)
  - 게시판, 팝업관리, 품목기준정보
- API 키 보안 개선 (NEXT_PUBLIC_API_KEY → API_KEY)
- Textarea 다크모드 스타일 개선
- DropdownField Radix UI Select 버그 수정 (key prop)
- 프로젝트 헬스 개선 계획서 문서화

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
byeongcheolryu
2025-12-20 14:33:11 +09:00
parent c6b605200d
commit d7f491fa84
50 changed files with 666 additions and 246 deletions

View File

@@ -4,33 +4,29 @@
/**
* API 요청에 사용할 헤더 생성 (프록시 패턴용)
* - Content-Type: application/json
* - X-API-KEY: 환경변수에서 로드
* - Accept: Laravel expectsJson() 체크용
*
* ⚠️ 중요: Authorization 헤더는 Next.js 프록시에서 서버사이드로 처리
* ⚠️ 중요: Authorization과 X-API-KEY는 Next.js 프록시에서 서버사이드로 처리
* - HttpOnly 쿠키는 JavaScript로 읽을 수 없음 (보안)
* - /api/proxy/* 라우트가 서버에서 쿠키 읽어 Authorization 헤더 추가
* - /api/proxy/* 라우트가 서버에서 쿠키와 API_KEY를 헤더 추가
*/
export const getAuthHeaders = (): HeadersInit => {
return {
'Content-Type': 'application/json',
'Accept': 'application/json',
'X-API-KEY': process.env.NEXT_PUBLIC_API_KEY || '',
};
};
/**
* Multipart/form-data 요청에 사용할 헤더 생성 (프록시 패턴용)
* - Content-Type은 브라우저가 자동으로 설정 (boundary 포함)
* - X-API-KEY만 포함
*
* ⚠️ 중요: Authorization 헤더는 Next.js 프록시에서 서버사이드로 처리
* - /api/proxy/* 라우트가 서버에서 쿠키 읽어 Authorization 헤더 추가
* ⚠️ 중요: Authorization과 X-API-KEY는 Next.js 프록시에서 서버사이드로 처리
* - /api/proxy/* 라우트가 서버에서 쿠키와 API_KEY를 헤더 추가
*/
export const getMultipartHeaders = (): HeadersInit => {
return {
'Accept': 'application/json',
'X-API-KEY': process.env.NEXT_PUBLIC_API_KEY || '',
// Content-Type은 명시하지 않음 (multipart/form-data; boundary=... 자동 설정)
};
};

View File

@@ -53,7 +53,7 @@ export async function proxyToPhpBackend(
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': `Bearer ${accessToken}`,
'X-API-KEY': process.env.NEXT_PUBLIC_API_KEY || '',
'X-API-KEY': process.env.API_KEY || '',
...options?.headers,
},
});