📦 add(db): 添加数据库路径

This commit is contained in:
BTMuli
2023-04-24 17:32:44 +08:00
parent 805b358e6d
commit eeba1f9978
2 changed files with 7 additions and 0 deletions

View File

@@ -120,6 +120,10 @@
路径 路径
</v-list-subheader> </v-list-subheader>
<v-divider inset class="border-opacity-75" /> <v-divider inset class="border-opacity-75" />
<v-list-item prepend-icon="mdi-database">
<v-list-item-title>本地数据库路径</v-list-item-title>
<v-list-item-subtitle>{{ appStore.dataPath.dbDataPath }}</v-list-item-subtitle>
</v-list-item>
<v-list-item prepend-icon="mdi-folder"> <v-list-item prepend-icon="mdi-folder">
<v-list-item-title>本地临时数据路径</v-list-item-title> <v-list-item-title>本地临时数据路径</v-list-item-title>
<v-list-item-subtitle>{{ appStore.dataPath.tempDataDir }}</v-list-item-subtitle> <v-list-item-subtitle>{{ appStore.dataPath.tempDataDir }}</v-list-item-subtitle>

View File

@@ -16,6 +16,8 @@ import { path } from "@tauri-apps/api";
const userDataDir = `${await path.appLocalDataDir()}userData`; const userDataDir = `${await path.appLocalDataDir()}userData`;
// 用于各种临时数据的路径 // 用于各种临时数据的路径
const tempDataDir = `${await path.appLocalDataDir()}tempData`; const tempDataDir = `${await path.appLocalDataDir()}tempData`;
// 用于存放数据库的路径
const dbDataPath = `${await path.appConfigDir()}tauri-genshin.db`;
export const useAppStore = defineStore( export const useAppStore = defineStore(
"app", "app",
@@ -44,6 +46,7 @@ export const useAppStore = defineStore(
const dataPath = reactive({ const dataPath = reactive({
userDataDir, userDataDir,
tempDataDir, tempDataDir,
dbDataPath,
}); });
// 用户数据路径 // 用户数据路径
const userPath = ref({ const userPath = ref({