mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2026-03-26 05:39:45 +08:00
👽️ 调整读取格式
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user