fix: 관리자 다운로드 폼 에러 피드백 추가 및 nginx HTML 캐싱 방지
All checks were successful
Client CI/CD / deploy (push) Successful in 9s

- 저장 실패 시 에러 메시지 표시
- nginx index.html Cache-Control: no-store 설정

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-24 22:34:45 +09:00
parent 4047014cea
commit 2163d0f311
3 changed files with 17 additions and 0 deletions

View File

@@ -67,6 +67,12 @@
border-color: rgba(186, 205, 176, 0.5);
}
.admin-error {
font-size: 0.85rem;
color: rgba(229, 115, 115, 0.9);
margin: 0;
}
.admin-form-actions {
display: flex;
gap: 8px;

View File

@@ -7,6 +7,7 @@ export default function DownloadAdmin() {
const [form, setForm] = useState({ url: '', version: '', fileName: '', fileSize: '', fileHash: '' });
const [loading, setLoading] = useState(false);
const [saved, setSaved] = useState(false);
const [error, setError] = useState('');
useEffect(() => {
getDownloadInfo()
@@ -23,6 +24,7 @@ export default function DownloadAdmin() {
const handleSubmit = async (e) => {
e.preventDefault();
setLoading(true);
setError('');
try {
await apiFetch('/api/download/info', {
method: 'PUT',
@@ -30,6 +32,8 @@ export default function DownloadAdmin() {
});
setSaved(true);
setTimeout(() => setSaved(false), 2000);
} catch (err) {
setError(err.message || '저장에 실패했습니다.');
} finally {
setLoading(false);
}
@@ -56,6 +60,7 @@ export default function DownloadAdmin() {
{field('파일명', 'fileName', 'A301_Launcher.zip')}
{field('파일 크기', 'fileSize', '1.2 GB')}
{field('A301.exe SHA256 해시', 'fileHash', 'sha256 해시값 (certutil -hashfile A301.exe SHA256)')}
{error && <p className="admin-error">{error}</p>}
<div className="admin-form-actions">
<button className="btn-admin-primary" type="submit" disabled={loading}>
{saved ? '저장됨 ✓' : '저장'}