From f0b3a311d730aa042581949a3822932ec4d324cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9B=AE=E6=A3=83?= Date: Fri, 26 Jul 2024 14:19:48 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E4=BF=AE=E5=A4=8D=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E6=95=B0=E6=8D=AE=E7=9B=AE=E5=BD=95=E6=89=93=E5=BC=80?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/config/tc-dataDir.vue | 31 +++++++++++++++++----------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/src/components/config/tc-dataDir.vue b/src/components/config/tc-dataDir.vue index 45d2004d..d56621c5 100644 --- a/src/components/config/tc-dataDir.vue +++ b/src/components/config/tc-dataDir.vue @@ -13,7 +13,7 @@ >mdi-pencil   - mdi-folder-open   @@ -48,12 +48,12 @@ mdi-deletemdi-folder-open + >mdi-folder-open +   mdi-content-copy + >mdi-content-copy + @@ -74,10 +74,7 @@ const appStore = useAppStore(); async function confirmCUD(): Promise { const oriDir = appStore.userDir; - const check = await showConfirm({ - title: "确认修改用户数据路径吗?", - text: "祈愿数据需修改后重新手动备份!", - }); + const check = await showConfirm({ title: "确认修改用户数据路径吗?" }); if (!check) { showSnackbar({ color: "cancel", @@ -107,11 +104,21 @@ async function confirmCUD(): Promise { appStore.userDir = dir; await TGSqlite.saveAppData("userDir", dir); await backUpUserData(dir); - await remove(oriDir, { recursive: true }); showSnackbar({ - text: "已重新备份数据!即将刷新页面!", - timeout: 3000, + text: "已重新备份数据!", + color: "success", + }); + const confirm = await showConfirm({ + title: "是否删除原用户数据目录?", + text: "删除后不可恢复!", }); + if (confirm) { + await remove(oriDir, { recursive: true }); + showSnackbar({ + text: "已删除原用户数据目录!", + color: "success", + }); + } setTimeout(() => { window.location.reload(); }, 4000);