From 02b53098e87d10b5b0258f3ac8ebb3965421f3f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=91=E5=85=88=E6=A3=AE?= Date: Thu, 28 Nov 2024 11:43:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=86=85=E6=A0=B8=E7=AE=A1=E7=90=86=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=20=E6=89=93=E5=BC=80=E5=86=85=E6=A0=B8=E7=BC=93?= =?UTF-8?q?=E5=AD=98=E7=9B=AE=E5=BD=95=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- env/.env.dev | 1 + env/.env.prod | 1 + package.json | 2 +- pages/index.vue | 19 ++++++++++++++++++- src-tauri/Cargo.lock | 2 +- src-tauri/Cargo.toml | 2 +- src-tauri/tauri.conf.json | 4 ++-- 7 files changed, 25 insertions(+), 6 deletions(-) diff --git a/env/.env.dev b/env/.env.dev index 719cd46..29c28e6 100644 --- a/env/.env.dev +++ b/env/.env.dev @@ -1,4 +1,5 @@ VITE_CONFIG_PATH=easytier/config/ VITE_CONFIG_FILE_NAME=easytier/config.json VITE_LOG_PATH=easytier/logs/ +VITE_CACHE_PATH=easytier/cache/ VITE_AUTO_START_SERVICE_NAME=easytierGameAutoStart \ No newline at end of file diff --git a/env/.env.prod b/env/.env.prod index 719cd46..29c28e6 100644 --- a/env/.env.prod +++ b/env/.env.prod @@ -1,4 +1,5 @@ VITE_CONFIG_PATH=easytier/config/ VITE_CONFIG_FILE_NAME=easytier/config.json VITE_LOG_PATH=easytier/logs/ +VITE_CACHE_PATH=easytier/cache/ VITE_AUTO_START_SERVICE_NAME=easytierGameAutoStart \ No newline at end of file diff --git a/package.json b/package.json index 705e352..ce74c58 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "private": true, "author": "leizi97", "description": "A simple network initiator based on Easytier", - "version": "1.2.6", + "version": "1.2.7", "scripts": { "dev": "nuxt dev --dotenv env/.env.dev --host 0.0.0.0", "build": "nuxt generate --dotenv env/.env.prod", diff --git a/pages/index.vue b/pages/index.vue index 7ef1204..9f8252b 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -335,6 +335,9 @@ > 刷新 + + + { + const cache_path = import.meta.env.VITE_CACHE_PATH; + const resourceDir = await getResourceDir(); + const configPath = await join(resourceDir, cache_path); + const isExists = await exists(cache_path, { baseDir: BaseDirectory.Resource }); + if (!isExists) { + try { + await mkdir(cache_path, { baseDir: BaseDirectory.Resource }); + } catch (err) {} + } + // console.error(configPath); + await Command.create("explorer", [configPath]).execute(); + } + const handleDeleteServerUrl = (url: string) => { const newBasePeers = [...mainStore.basePeers]; const idx = newBasePeers.indexOf(url); diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index dace403..e1c87fc 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -1176,7 +1176,7 @@ checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" [[package]] name = "easytier-game" -version = "1.2.6" +version = "1.2.7" dependencies = [ "log", "planif", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 90e28f9..6d4c620 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "easytier-game" -version = "1.2.6" +version = "1.2.7" homepage = "https://github.com/EasyTier/EasyTier" repository = "https://github.com/EasyTier/EasytierGame" description = "A simple network initiator based on Easytier" diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 667d94d..ce22afd 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "../node_modules/@tauri-apps/cli/config.schema.json", "productName": "easytier-game", - "version": "1.2.6", + "version": "1.2.7", "identifier": "com.tauri.easytier-game", "build": { @@ -13,7 +13,7 @@ "app": { "windows": [ { - "title": "easytier-game 1.2.6", + "title": "easytier-game 1.2.7", "label": "main", "minWidth": 340, "width": 340,