Merge pull request #170 from RWDai/fix-config-version

fix: 配置导入导出版本号统一常量管理,移除前端硬编码版本校验
This commit is contained in:
fawney19
2026-02-11 23:26:33 +08:00
committed by GitHub
2 changed files with 9 additions and 7 deletions

View File

@@ -1795,9 +1795,9 @@ function handleConfigFileSelect(event: Event) {
const content = e.target?.result as string
const data = JSON.parse(content) as ConfigExportData
// 验证版本(支持 2.0 和 2.1
if (!['2.0', '2.1'].includes(data.version)) {
error(`不支持的配置版本: ${data.version}`)
// 基本格式验证:确保有版本字段
if (!data.version) {
error('无效的配置文件:缺少版本信息')
return
}