From 1b617939706cd93e1577625d7917899243b582f3 Mon Sep 17 00:00:00 2001 From: BTMuli Date: Wed, 8 Mar 2023 08:15:26 +0800 Subject: [PATCH] =?UTF-8?q?fix(#2):=20=E4=BF=AE=E5=A4=8D=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E6=96=87=E4=BB=B6=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src-tauri/tauri.conf.json | 8 ++++++-- src/store/modules/app.ts | 10 +++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 6fd82595..ac9115e5 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -4,7 +4,7 @@ "beforeBuildCommand": "npm run build", "devPath": "http://localhost:1420", "distDir": "../dist", - "withGlobalTauri": false + "withGlobalTauri": true }, "package": { "productName": "tauri-genshin", @@ -13,6 +13,10 @@ "tauri": { "allowlist": { "all": true, + "fs": { + "all": true, + "scope": ["**", "**/*"] + }, "http": { "all": true, "request": true, @@ -26,7 +30,7 @@ "bundle": { "active": true, "icon": ["icons/icon.png", "icons/icon.ico"], - "identifier": "com.tauri.dev", + "identifier": "tauri-genshin", "targets": "all" }, "security": { diff --git a/src/store/modules/app.ts b/src/store/modules/app.ts index 41abd76b..960e32d6 100644 --- a/src/store/modules/app.ts +++ b/src/store/modules/app.ts @@ -1,6 +1,6 @@ import { defineStore } from "pinia"; -export const useAppStore = defineStore({ +const useAppStore = defineStore({ id: "app", state: () => { return { @@ -8,7 +8,15 @@ export const useAppStore = defineStore({ sidebar: { expand: true, }, + dataPath: "", }; }, + actions: { + setDataPath(path: string) { + this.dataPath = path; + }, + }, persist: true, }); + +export default useAppStore;