mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-13 09:28:14 +08:00
🐛 修复用户数据目录打开失败
This commit is contained in:
@@ -13,7 +13,7 @@
|
|||||||
>mdi-pencil
|
>mdi-pencil
|
||||||
</v-icon>
|
</v-icon>
|
||||||
 
|
 
|
||||||
<v-icon @clikc="openPath('user')" style="cursor: pointer" title="打开用户数据目录"
|
<v-icon @click="openPath('user')" style="cursor: pointer" title="打开用户数据目录"
|
||||||
>mdi-folder-open
|
>mdi-folder-open
|
||||||
</v-icon>
|
</v-icon>
|
||||||
 
|
 
|
||||||
@@ -48,12 +48,12 @@
|
|||||||
<v-icon @click="confirmCLD" style="cursor: pointer" title="清理日志文件">mdi-delete</v-icon>
|
<v-icon @click="confirmCLD" style="cursor: pointer" title="清理日志文件">mdi-delete</v-icon>
|
||||||
 
|
 
|
||||||
<v-icon @click="openPath('log')" style="cursor: pointer" title="打开日志目录"
|
<v-icon @click="openPath('log')" style="cursor: pointer" title="打开日志目录"
|
||||||
>mdi-folder-open</v-icon
|
>mdi-folder-open
|
||||||
>
|
</v-icon>
|
||||||
 
|
 
|
||||||
<v-icon @click="copyPath('log')" style="cursor: pointer" title="复制日志目录路径"
|
<v-icon @click="copyPath('log')" style="cursor: pointer" title="复制日志目录路径"
|
||||||
>mdi-content-copy</v-icon
|
>mdi-content-copy
|
||||||
>
|
</v-icon>
|
||||||
</template>
|
</template>
|
||||||
</v-list-item>
|
</v-list-item>
|
||||||
</v-list>
|
</v-list>
|
||||||
@@ -74,10 +74,7 @@ const appStore = useAppStore();
|
|||||||
|
|
||||||
async function confirmCUD(): Promise<void> {
|
async function confirmCUD(): Promise<void> {
|
||||||
const oriDir = appStore.userDir;
|
const oriDir = appStore.userDir;
|
||||||
const check = await showConfirm({
|
const check = await showConfirm({ title: "确认修改用户数据路径吗?" });
|
||||||
title: "确认修改用户数据路径吗?",
|
|
||||||
text: "祈愿数据需修改后重新手动备份!",
|
|
||||||
});
|
|
||||||
if (!check) {
|
if (!check) {
|
||||||
showSnackbar({
|
showSnackbar({
|
||||||
color: "cancel",
|
color: "cancel",
|
||||||
@@ -107,11 +104,21 @@ async function confirmCUD(): Promise<void> {
|
|||||||
appStore.userDir = dir;
|
appStore.userDir = dir;
|
||||||
await TGSqlite.saveAppData("userDir", dir);
|
await TGSqlite.saveAppData("userDir", dir);
|
||||||
await backUpUserData(dir);
|
await backUpUserData(dir);
|
||||||
await remove(oriDir, { recursive: true });
|
|
||||||
showSnackbar({
|
showSnackbar({
|
||||||
text: "已重新备份数据!即将刷新页面!",
|
text: "已重新备份数据!",
|
||||||
timeout: 3000,
|
color: "success",
|
||||||
});
|
});
|
||||||
|
const confirm = await showConfirm({
|
||||||
|
title: "是否删除原用户数据目录?",
|
||||||
|
text: "删除后不可恢复!",
|
||||||
|
});
|
||||||
|
if (confirm) {
|
||||||
|
await remove(oriDir, { recursive: true });
|
||||||
|
showSnackbar({
|
||||||
|
text: "已删除原用户数据目录!",
|
||||||
|
color: "success",
|
||||||
|
});
|
||||||
|
}
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
}, 4000);
|
}, 4000);
|
||||||
|
|||||||
Reference in New Issue
Block a user