feat: 按安装目录隔离存储应用数据,实现多实例独立运行
新增 StoragePaths 模块,将数据库、设置、frp 版本等业务数据统一保存在应用实际安装位置,避免不同实例或版本间数据混淆。新增 Preferences 模块管理安装目录内的持久化设置,重构数据库初始化逻辑,修改 Frpc 运行目录、frp 版本存储路径,新增数据目录锁机制防止多进程冲突,同时更新文档说明数据目录规则与平台差异。
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import type { Update } from "@tauri-apps/plugin-updater"
|
||||
import { isTauri } from "@/utils/window"
|
||||
import { flushPreferences } from "@/utils/preferences"
|
||||
|
||||
/** 项目 GitHub 仓库地址(与 tauri.conf.json 中 updater 端点保持一致) */
|
||||
export const PROJECT_GITHUB_URL = "https://github.com/SparksFly91/FrpcPilot"
|
||||
@@ -18,6 +19,7 @@ export async function checkForAppUpdate(): Promise<Update | null> {
|
||||
/** 重启应用(macOS / Linux 安装更新后需要重启才能运行新版本) */
|
||||
export async function relaunchApp() {
|
||||
if (!isTauri()) return
|
||||
await flushPreferences()
|
||||
const { relaunch } = await import("@tauri-apps/plugin-process")
|
||||
await relaunch()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user