fix: 관리자 다운로드 폼 에러 피드백 추가 및 nginx HTML 캐싱 방지
All checks were successful
Client CI/CD / deploy (push) Successful in 9s
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:
@@ -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 ? '저장됨 ✓' : '저장'}
|
||||
|
||||
Reference in New Issue
Block a user