diff --git a/src/pages/User/Gacha.vue b/src/pages/User/Gacha.vue index f835e127..07404bcb 100644 --- a/src/pages/User/Gacha.vue +++ b/src/pages/User/Gacha.vue @@ -102,7 +102,7 @@ async function confirmRefresh(): Promise { }); if (!confirmRes) { showSnackbar({ - color: "grey", + color: "cancel", text: "已取消刷新祈愿数据", }); return; @@ -244,7 +244,7 @@ async function handleImportBtn(savePath?: string): Promise { }); if (!res) { showSnackbar({ - color: "grey", + color: "cancel", text: "已取消祈愿数据导入", }); return; @@ -269,7 +269,7 @@ async function handleImportBtn(savePath?: string): Promise { } } else { showSnackbar({ - color: "grey", + color: "cancel", text: "已取消文件选择", }); } @@ -291,7 +291,7 @@ async function handleExportBtn(): Promise { }); if (!res) { showSnackbar({ - color: "grey", + color: "cancel", text: "已取消祈愿数据导出", }); return; @@ -308,7 +308,7 @@ async function handleExportBtn(): Promise { }); if (!file) { showSnackbar({ - color: "grey", + color: "cancel", text: "已取消文件保存", }); return; @@ -343,7 +343,7 @@ async function backupGacha(): Promise { }); if (!res) { showSnackbar({ - color: "grey", + color: "cancel", text: "已取消祈愿数据备份", }); return; @@ -375,7 +375,7 @@ async function deleteGacha(): Promise { }); if (!firstConfirm) { showSnackbar({ - color: "grey", + color: "cancel", text: "已取消祈愿数据删除", }); return; @@ -390,7 +390,7 @@ async function deleteGacha(): Promise { } if (!secondConfirm) { showSnackbar({ - color: "grey", + color: "cancel", text: "已取消祈愿数据删除", }); return; diff --git a/src/pages/common/Achievements.vue b/src/pages/common/Achievements.vue index ab6baa44..6a30d060 100644 --- a/src/pages/common/Achievements.vue +++ b/src/pages/common/Achievements.vue @@ -282,7 +282,7 @@ async function importJson(): Promise { }); if (!selectedFile) { showSnackbar({ - color: "grey", + color: "cancel", text: "已取消文件选择", }); return; diff --git a/src/pages/common/Config.vue b/src/pages/common/Config.vue index d8b19ee6..81c3f4fe 100644 --- a/src/pages/common/Config.vue +++ b/src/pages/common/Config.vue @@ -252,7 +252,7 @@ async function confirmRefreshUser(): Promise { }); if (!res) { showSnackbar({ - color: "grey", + color: "cancel", text: "已取消刷新", }); return; @@ -360,13 +360,14 @@ async function confirmBackup(): Promise { }); if (!res) { showSnackbar({ - color: "grey", + color: "cancel", text: "已取消备份", }); return; } loadingTitle.value = "正在备份数据..."; loading.value = true; + // todo 这边采用自定义路径 if (!(await fs.exists("userData", { dir: fs.BaseDirectory.AppLocalData }))) { await fs.createDir("userData", { dir: fs.BaseDirectory.AppLocalData, recursive: true }); } @@ -374,15 +375,19 @@ async function confirmBackup(): Promise { loadingSub.value = "正在获取成就数据"; const achievements = await TGSqlite.getUIAF(); loadingSub.value = "正在备份成就数据"; + // todo 自定义路径 await backupUiafData(achievements); loadingSub.value = "正在获取 Cookie"; const cookie = await TGSqlite.getCookie(); loadingSub.value = "正在备份 Cookie"; + // todo 自定义路径 await backupCookieData(cookie); loadingSub.value = "正在获取深渊数据"; const abyss = await TGSqlite.getAbyss(); loadingSub.value = "正在备份深渊数据"; + // todo 自定义路径 await backupAbyssData(abyss); + // todo 其他数据备份? loadingSub.value = ""; loading.value = false; showSnackbar({ text: "数据已备份!" }); @@ -396,11 +401,12 @@ async function confirmRestore(): Promise { }); if (!resConfirm) { showSnackbar({ - color: "grey", + color: "cancel", text: "已取消恢复", }); return; } + // todo 自定义路径 loadingTitle.value = "正在恢复数据..."; loading.value = true; if (!(await fs.exists("userData", { dir: fs.BaseDirectory.AppLocalData }))) { @@ -413,17 +419,20 @@ async function confirmRestore(): Promise { const fail: string[] = []; let res: boolean; loadingSub.value = "正在恢复成就数据"; + // todo 自定义路径 res = await restoreUiafData(); if (!res) { fail.push("成就数据"); } loadingSub.value = "正在恢复祈愿数据"; + // todo 自定义路径 res = await restoreCookieData(); userStore.cookie.value = await TGSqlite.getCookie(); if (!res) { fail.push("Cookie"); } loadingSub.value = "正在恢复深渊数据"; + // todo 自定义路径 res = await restoreAbyssData(); if (!res) { fail.push("深渊数据"); @@ -434,6 +443,9 @@ async function confirmRestore(): Promise { loading.value = false; } +// todo 设置自定义数据保存路径并进行数据迁移 +// todo macOS 需要测试 + // 更新数据 async function confirmUpdate(title?: string): Promise { const res = await showConfirm({ @@ -442,7 +454,7 @@ async function confirmUpdate(title?: string): Promise { }); if (!res) { showSnackbar({ - color: "grey", + color: "cancel", text: "已取消更新数据库", }); return; @@ -546,7 +558,7 @@ async function confirmDelCache(): Promise { }); if (!res) { showSnackbar({ - color: "grey", + color: "cancel", text: "已取消清除缓存", }); return; @@ -571,7 +583,7 @@ async function confirmResetApp(): Promise { }); if (!res) { showSnackbar({ - color: "grey", + color: "cancel", text: "已取消恢复默认设置", }); return; @@ -594,7 +606,7 @@ async function tryShowReset(): Promise { }); if (!res) { showSnackbar({ - color: "grey", + color: "cancel", text: "已取消", }); return; @@ -622,7 +634,7 @@ async function confirmResetDB(title?: string): Promise { }); if (!res) { showSnackbar({ - color: "grey", + color: "cancel", text: "已取消重置数据库", }); return;