mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2026-05-09 00:34:07 +08:00
🧑💻 配置分平台
This commit is contained in:
65
src-tauri/capabilities/TeyvatGuide.json
Normal file
65
src-tauri/capabilities/TeyvatGuide.json
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
{
|
||||||
|
"$schema": "./schemas/desktop-schema.json",
|
||||||
|
"identifier": "TeyvatGuide",
|
||||||
|
"description": "Capability for the main window",
|
||||||
|
"windows": ["TeyvatGuide"],
|
||||||
|
"permissions": [
|
||||||
|
"core:app:default",
|
||||||
|
"core:app:allow-version",
|
||||||
|
"core:event:default",
|
||||||
|
"core:event:allow-listen",
|
||||||
|
"core:path:default",
|
||||||
|
"core:path:allow-resolve-directory",
|
||||||
|
"core:webview:default",
|
||||||
|
"core:webview:allow-create-webview-window",
|
||||||
|
"core:webview:allow-set-webview-zoom",
|
||||||
|
"core:window:default",
|
||||||
|
"core:window:allow-center",
|
||||||
|
"core:window:allow-close",
|
||||||
|
"core:window:allow-destroy",
|
||||||
|
"core:window:allow-is-minimized",
|
||||||
|
"core:window:allow-set-focus",
|
||||||
|
"core:window:allow-set-size",
|
||||||
|
"core:window:allow-set-title",
|
||||||
|
"core:window:allow-show",
|
||||||
|
"core:window:allow-unminimize",
|
||||||
|
"cli:default",
|
||||||
|
"cli:allow-cli-matches",
|
||||||
|
"dialog:default",
|
||||||
|
"dialog:allow-save",
|
||||||
|
"fs:default",
|
||||||
|
"http:allow-fetch",
|
||||||
|
"log:default",
|
||||||
|
"log:allow-log",
|
||||||
|
"machine-uid:default",
|
||||||
|
"machine-uid:allow-get-machine-uid",
|
||||||
|
"notification:default",
|
||||||
|
"opener:default",
|
||||||
|
"process:default",
|
||||||
|
"process:allow-exit",
|
||||||
|
"sql:default",
|
||||||
|
"sql:allow-load",
|
||||||
|
"sql:allow-execute",
|
||||||
|
{ "identifier": "fs:allow-exists", "allow": [{ "path": "**" }] },
|
||||||
|
{ "identifier": "fs:allow-mkdir", "allow": [{ "path": "**" }] },
|
||||||
|
{ "identifier": "fs:allow-read-dir", "allow": [{ "path": "**" }] },
|
||||||
|
{ "identifier": "fs:allow-read-text-file", "allow": [{ "path": "**" }] },
|
||||||
|
{ "identifier": "fs:allow-read-text-file-lines", "allow": [{ "path": "**" }] },
|
||||||
|
{ "identifier": "fs:allow-remove", "allow": [{ "path": "**" }] },
|
||||||
|
{ "identifier": "fs:allow-write-file", "allow": [{ "path": "**" }] },
|
||||||
|
{ "identifier": "fs:allow-write-text-file", "allow": [{ "path": "**" }] },
|
||||||
|
{ "identifier": "opener:allow-open-path", "allow": [{ "path": "**" }] },
|
||||||
|
{ "identifier": "opener:allow-open-url", "allow": [{ "url": "**" }] },
|
||||||
|
{
|
||||||
|
"identifier": "http:default",
|
||||||
|
"allow": [
|
||||||
|
{ "url": "https://*.miyoushe.com/*" },
|
||||||
|
{ "url": "https://*.mihoyo.com/*" },
|
||||||
|
{ "url": "https://homa.gentle.house/*" },
|
||||||
|
{ "url": "https://*.hoyoverse.com/*" },
|
||||||
|
{ "url": "https://api.hakush.in/*" }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"platforms": ["windows", "macOS"]
|
||||||
|
}
|
||||||
@@ -26,7 +26,7 @@ fn window_event_handler(app: &Window, event: &WindowEvent) {
|
|||||||
match event {
|
match event {
|
||||||
WindowEvent::CloseRequested { api, .. } => {
|
WindowEvent::CloseRequested { api, .. } => {
|
||||||
api.prevent_close();
|
api.prevent_close();
|
||||||
if app.label() == "Teyvat.Guide" {
|
if app.label() == "TeyvatGuide" {
|
||||||
// 主窗口:发送事件让前端根据配置决定是隐藏还是退出
|
// 主窗口:发送事件让前端根据配置决定是隐藏还是退出
|
||||||
let _ = app.emit("main-window-close-requested", ());
|
let _ = app.emit("main-window-close-requested", ());
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://schema.tauri.app/config/2",
|
"$schema": "https://schema.tauri.app/config/2",
|
||||||
"productName": "TeyvatGuide",
|
"productName": "TeyvatGuide",
|
||||||
"identifier": "Teyvat.Guide",
|
"identifier": "TeyvatGuide",
|
||||||
"version": "0.9.1",
|
"version": "0.9.1",
|
||||||
"build": {
|
"build": {
|
||||||
"beforeDevCommand": "pnpm vite:dev",
|
"beforeDevCommand": "pnpm vite:dev",
|
||||||
@@ -30,8 +30,7 @@
|
|||||||
],
|
],
|
||||||
"targets": ["msi", "app", "dmg"],
|
"targets": ["msi", "app", "dmg"],
|
||||||
"windows": { "wix": { "language": "zh-CN" } },
|
"windows": { "wix": { "language": "zh-CN" } },
|
||||||
"macOS": {},
|
"macOS": {}
|
||||||
"resources": { "lib/YaeAchievementLib.dll": "resources/YaeAchievementLib.dll" }
|
|
||||||
},
|
},
|
||||||
"app": {
|
"app": {
|
||||||
"withGlobalTauri": true,
|
"withGlobalTauri": true,
|
||||||
@@ -48,7 +47,7 @@
|
|||||||
"visible": false
|
"visible": false
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"security": { "capabilities": ["Teyvat.Guide", "Mys", "SubWindow", "DevJson"] }
|
"security": { "capabilities": ["TeyvatGuide", "Mys", "SubWindow", "DevJson"] }
|
||||||
},
|
},
|
||||||
"plugins": {
|
"plugins": {
|
||||||
"deep-link": { "desktop": { "schemes": ["teyvatguide"] }, "mobile": [] },
|
"deep-link": { "desktop": { "schemes": ["teyvatguide"] }, "mobile": [] },
|
||||||
|
|||||||
7
src-tauri/tauri.linux.conf.json
Normal file
7
src-tauri/tauri.linux.conf.json
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://schema.tauri.app/config/2",
|
||||||
|
"identifier": "Teyvat.Guide",
|
||||||
|
"app": {
|
||||||
|
"security": { "capabilities": ["Teyvat.Guide", "Mys", "SubWindow", "DevJson"] }
|
||||||
|
}
|
||||||
|
}
|
||||||
6
src-tauri/tauri.windows.conf.json
Normal file
6
src-tauri/tauri.windows.conf.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://schema.tauri.app/config/2",
|
||||||
|
"bundle": {
|
||||||
|
"resources": { "lib/YaeAchievementLib.dll": "resources/YaeAchievementLib.dll" }
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user