️ 不允许低于 UIGF v2.3 版本的数据导入

This commit is contained in:
目棃
2024-07-18 18:04:12 +08:00
parent 41ee27c74e
commit 5bf2521938
13 changed files with 778 additions and 719 deletions

View File

@@ -1,7 +1,7 @@
/**
* @file utils/UIGF.ts
* @description UIGF工具类
* @since Beta v0.5.0
* @since Beta v0.5.1
*/
import { app, path } from "@tauri-apps/api";
@@ -110,7 +110,7 @@ export async function verifyUigfData(path: string, isVersion4: boolean = false):
/**
* @description 验证 UIGF 数据
* @since Beta v0.5.0
* @since Beta v0.5.1
* @param {object} data - UIGF 数据
* @returns {boolean} 是否验证通过
*/
@@ -126,6 +126,14 @@ function validateUigfData(data: object): boolean {
});
return false;
}
const parsedData: TGApp.Plugins.UIGF.Schema = <TGApp.Plugins.UIGF.Schema>data;
if (parsedData.info.uigf_version < "v2.3") {
showSnackbar({
text: "UIGF 版本过低,请使用 v2.3 或以上版本",
color: "error",
});
return false;
}
return true;
}