mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-16 09:58:13 +08:00
✨ 采用 ajv 验证 UIGF #109
This commit is contained in:
@@ -304,13 +304,7 @@ async function handleImportBtn(savePath?: string): Promise<void> {
|
||||
return;
|
||||
}
|
||||
const check = await verifyUigfData(<string>selectedFile);
|
||||
if (!check) {
|
||||
showSnackbar({
|
||||
color: "error",
|
||||
text: "读取 UIGF 文件失败,请检查文件是否符合规范",
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (!check) return;
|
||||
const remoteData = await readUigfData(<string>selectedFile);
|
||||
const res = await showConfirm({
|
||||
title: "是否导入祈愿数据?",
|
||||
@@ -342,9 +336,9 @@ async function handleImportBtn(savePath?: string): Promise<void> {
|
||||
await TGLogger.Info(
|
||||
`[UserGacha][handleImportBtn] 成功导入 ${remoteData.info.uid} 的 ${remoteData.list.length} 条祈愿数据`,
|
||||
);
|
||||
// setTimeout(() => {
|
||||
// window.location.reload();
|
||||
// }, 1000);
|
||||
setTimeout(() => {
|
||||
window.location.reload();
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
// 导出按钮点击事件
|
||||
|
||||
Reference in New Issue
Block a user