feat: 前端页面使用网站基础配置

- 使用 Flask context_processor 自动注入 site_config
- 所有页面标题使用 site_name 配置
- 所有页面导航栏品牌使用 site_name 配置
- 所有页面底部使用 site_footer 配置
- 文件上传时使用 max_file_size 配置验证文件大小
- 显示最大文件限制提示
This commit is contained in:
2026-04-16 18:44:57 +08:00
parent aa8526035b
commit 69e4ca4d64
9 changed files with 68 additions and 17 deletions

View File

@@ -23,6 +23,14 @@ document.getElementById('uploadForm').addEventListener('submit', async function(
return;
}
// 检查文件大小
const maxSizeMB = parseInt(document.getElementById('submitBtn').dataset.maxSize) || 50;
const fileSizeMB = file.size / (1024 * 1024);
if (fileSizeMB > maxSizeMB) {
alert(`文件大小超出限制(最大${maxSizeMB}MB当前${fileSizeMB.toFixed(1)}MB`);
return;
}
// 显示进度区域
document.getElementById('progressSection').style.display = 'block';
document.getElementById('resultSection').style.display = 'none';