👽️ 调整读取格式

This commit is contained in:
BTMuli
2025-11-19 13:50:47 +08:00
parent f029306ebb
commit d96d451156
3 changed files with 12 additions and 6 deletions

View File

@@ -273,8 +273,8 @@ async function tryReadAbyss(): Promise<void> {
}
// TODO:数据结构
for (const item of fileData) {
await showLoading.update(`Uid: ${item["Uid"]},ScheduleId: ${item["ScheduleId"]}`);
await TSUserAbyss.saveAbyss(item["Uid"], item["SpiralAbyss"]);
await showLoading.update(`Uid: ${item["uid"]},ScheduleId: ${item["schedule_id"]}`);
await TSUserAbyss.saveAbyss(item["uid"], item["data"]);
}
await showLoading.end();
showSnackbar.success(`成功导入 ${fileData.length} 条深渊数据,即将刷新页面`);
@@ -282,7 +282,9 @@ async function tryReadAbyss(): Promise<void> {
window.location.reload();
} catch (e) {
console.error(e);
await TGLogger.Error(`[UserAbyss][tryReadAbyss] 导入深渊数据失败: ${e}`);
await showLoading.end();
showSnackbar.error("导入深渊数据失败,请检查文件格式是否正确");
}
}
</script>

View File

@@ -369,8 +369,8 @@ async function tryReadChallenge(): Promise<void> {
}
// TODO:数据结构
for (const item of fileData) {
await showLoading.update(`Uid: ${item["Uid"]},ScheduleId: ${item["ScheduleId"]}`);
await TSUserChallenge.saveChallenge(item["Uid"], item["HardChallengeData"]);
await showLoading.update(`Uid: ${item["uid"]},ScheduleId: ${item["schedule_id"]}`);
await TSUserChallenge.saveChallenge(item["uid"], item["data"]);
}
await showLoading.end();
showSnackbar.success(`成功导入 ${fileData.length} 条危战数据,即将刷新页面`);
@@ -378,7 +378,9 @@ async function tryReadChallenge(): Promise<void> {
window.location.reload();
} catch (e) {
console.error(e);
await TGLogger.Error(`[UserChallenge][tryReadChallenge] 导入危战数据失败: ${e}`);
await showLoading.end();
showSnackbar.error("导入危战数据失败,请检查文件格式是否正确");
}
}
</script>

View File

@@ -262,8 +262,8 @@ async function tryReadCombat(): Promise<void> {
}
// TODO:数据结构
for (const item of fileData) {
await showLoading.update(`Uid: ${item["Uid"]},ScheduleId: ${item["ScheduleId"]}`);
await TSUserCombat.saveCombat(item["Uid"], item["RoleCombatData"]);
await showLoading.update(`Uid: ${item["uid"]},ScheduleId: ${item["schedule_id"]}`);
await TSUserCombat.saveCombat(item["uid"], item["data"]);
}
await showLoading.end();
showSnackbar.success(`成功导入 ${fileData.length} 条剧诗数据,即将刷新页面`);
@@ -271,7 +271,9 @@ async function tryReadCombat(): Promise<void> {
window.location.reload();
} catch (e) {
console.error(e);
await TGLogger.Error(`[UserCombat][tryReadCombat] 导入剧诗数据失败: ${e}`);
await showLoading.end();
showSnackbar.error("导入剧诗数据失败,请检查文件格式是否正确");
}
}
</script>