mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2026-03-19 04:29:45 +08:00
♻️ 初步更改,cargo build
This commit is contained in:
@@ -15,3 +15,4 @@ qodana.yaml
|
||||
*.svg
|
||||
# data
|
||||
!src/data/**/*.json
|
||||
src-tauri/gen/*.json
|
||||
|
||||
@@ -13,6 +13,7 @@ export default [
|
||||
"pnpm-lock.yaml",
|
||||
"src/data/**/*.json",
|
||||
"src-tauri/tauri.conf.json",
|
||||
"src-tauri/gen/*.json",
|
||||
"qodana.yaml",
|
||||
".github",
|
||||
".vscode",
|
||||
|
||||
11
package.json
11
package.json
@@ -40,7 +40,7 @@
|
||||
"prettier --write"
|
||||
],
|
||||
"*.rs": [
|
||||
"rustfmt"
|
||||
"cargo fmt"
|
||||
]
|
||||
},
|
||||
"keywords": [
|
||||
@@ -66,7 +66,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@mdi/font": "7.4.47",
|
||||
"@tauri-apps/api": "^1.5.6",
|
||||
"@tauri-apps/api": "2.0.0-beta.14",
|
||||
"@tauri-apps/plugin-shell": "2.0.0-beta.6",
|
||||
"ajv": "^8.16.0",
|
||||
"artplayer": "^5.1.6",
|
||||
"clipboard": "^2.0.11",
|
||||
@@ -77,8 +78,8 @@
|
||||
"pinia": "^2.1.7",
|
||||
"pinia-plugin-persistedstate": "^3.2.1",
|
||||
"qrcode.vue": "^3.4.1",
|
||||
"tauri-plugin-log-api": "github:tauri-apps/tauri-plugin-log#v1",
|
||||
"tauri-plugin-sql-api": "github:tauri-apps/tauri-plugin-sql#v1",
|
||||
"tauri-plugin-log-api": "github:tauri-apps/tauri-plugin-log#v2",
|
||||
"tauri-plugin-sql-api": "github:tauri-apps/tauri-plugin-sql#v2",
|
||||
"uuid": "^10.0.0",
|
||||
"vue": "^3.4.30",
|
||||
"vue-echarts": "^6.7.3",
|
||||
@@ -91,7 +92,7 @@
|
||||
"devDependencies": {
|
||||
"@eslint/eslintrc": "^3.1.0",
|
||||
"@eslint/js": "^9.5.0",
|
||||
"@tauri-apps/cli": "^1.5.14",
|
||||
"@tauri-apps/cli": "2.0.0-beta.21",
|
||||
"@types/color-convert": "^2.0.3",
|
||||
"@types/js-md5": "^0.7.2",
|
||||
"@types/node": "^20.14.9",
|
||||
|
||||
179
pnpm-lock.yaml
generated
179
pnpm-lock.yaml
generated
@@ -12,8 +12,11 @@ importers:
|
||||
specifier: 7.4.47
|
||||
version: 7.4.47
|
||||
'@tauri-apps/api':
|
||||
specifier: ^1.5.6
|
||||
version: 1.5.6
|
||||
specifier: 2.0.0-beta.14
|
||||
version: 2.0.0-beta.14
|
||||
'@tauri-apps/plugin-shell':
|
||||
specifier: 2.0.0-beta.6
|
||||
version: 2.0.0-beta.6
|
||||
ajv:
|
||||
specifier: ^8.16.0
|
||||
version: 8.16.0
|
||||
@@ -45,11 +48,11 @@ importers:
|
||||
specifier: ^3.4.1
|
||||
version: 3.4.1(vue@3.4.30(typescript@5.5.2))
|
||||
tauri-plugin-log-api:
|
||||
specifier: github:tauri-apps/tauri-plugin-log#v1
|
||||
version: https://codeload.github.com/tauri-apps/tauri-plugin-log/tar.gz/752531f21f626c9f9f1716a28c4a37054c679657
|
||||
specifier: github:tauri-apps/tauri-plugin-log#v2
|
||||
version: '@tauri-apps/plugin-log@git+https://git@github.com:tauri-apps/tauri-plugin-log.git#2ca437c04b617664350609a0006089b63581fbec'
|
||||
tauri-plugin-sql-api:
|
||||
specifier: github:tauri-apps/tauri-plugin-sql#v1
|
||||
version: https://codeload.github.com/tauri-apps/tauri-plugin-sql/tar.gz/fe26880383d97d28ab0cc339773e75ce80730ced
|
||||
specifier: github:tauri-apps/tauri-plugin-sql#v2
|
||||
version: '@tauri-apps/plugin-sql@git+https://git@github.com:tauri-apps/tauri-plugin-sql.git#4dde23a4fdaec61f538aa784922d8b74d1ff1c0c'
|
||||
uuid:
|
||||
specifier: ^10.0.0
|
||||
version: 10.0.0
|
||||
@@ -82,8 +85,8 @@ importers:
|
||||
specifier: ^9.5.0
|
||||
version: 9.5.0
|
||||
'@tauri-apps/cli':
|
||||
specifier: ^1.5.14
|
||||
version: 1.5.14
|
||||
specifier: 2.0.0-beta.21
|
||||
version: 2.0.0-beta.21
|
||||
'@types/color-convert':
|
||||
specifier: ^2.0.3
|
||||
version: 2.0.3
|
||||
@@ -755,83 +758,30 @@ packages:
|
||||
cpu: [x64]
|
||||
os: [win32]
|
||||
|
||||
'@tauri-apps/api@1.5.3':
|
||||
resolution: {integrity: sha512-zxnDjHHKjOsrIzZm6nO5Xapb/BxqUq1tc7cGkFXsFkGTsSWgCPH1D8mm0XS9weJY2OaR73I3k3S+b7eSzJDfqA==}
|
||||
engines: {node: '>= 14.6.0', npm: '>= 6.6.0', yarn: '>= 1.19.1'}
|
||||
'@tauri-apps/api@2.0.0-beta.13':
|
||||
resolution: {integrity: sha512-Np1opKANzRMF3lgJ9gDquBCB9SxlE2lRmNpVx1+L6RyzAmigkuh0ZulT5jMnDA3JLsuSDU135r/s4t/Pmx4atg==}
|
||||
engines: {node: '>= 18', npm: '>= 6.6.0', yarn: '>= 1.19.1'}
|
||||
|
||||
'@tauri-apps/api@1.5.6':
|
||||
resolution: {integrity: sha512-LH5ToovAHnDVe5Qa9f/+jW28I6DeMhos8bNDtBOmmnaDpPmJmYLyHdeDblAWWWYc7KKRDg9/66vMuKyq0WIeFA==}
|
||||
engines: {node: '>= 14.6.0', npm: '>= 6.6.0', yarn: '>= 1.19.1'}
|
||||
'@tauri-apps/api@2.0.0-beta.14':
|
||||
resolution: {integrity: sha512-YLYgHqdwWswr4Y70+hRzaLD6kLIUgHhE3shLXNquPiTaQ9+cX3Q2dB0AFfqsua6NXYFNe7LfkmMzaqEzqv3yQg==}
|
||||
engines: {node: '>= 18.18', npm: '>= 6.6.0', yarn: '>= 1.19.1'}
|
||||
|
||||
'@tauri-apps/cli-darwin-arm64@1.5.14':
|
||||
resolution: {integrity: sha512-lxoSOp3KKSqzHJa7iT32dukPGMlfsTuja1xXSgwR8o/fqzpYJY7FY/3ZxesP8HR66FcK+vtqa//HNqeOQ0mHkA==}
|
||||
engines: {node: '>= 10'}
|
||||
cpu: [arm64]
|
||||
os: [darwin]
|
||||
|
||||
'@tauri-apps/cli-darwin-x64@1.5.14':
|
||||
resolution: {integrity: sha512-EXSwN1n5spfG8FoXuyc90ACtmDJXzaZ1gxyENaq9xEpQoo7j/Q1vb6qXxmr6azKr8zmqY4h08ZFbv3exh93xJg==}
|
||||
engines: {node: '>= 10'}
|
||||
cpu: [x64]
|
||||
os: [darwin]
|
||||
|
||||
'@tauri-apps/cli-linux-arm-gnueabihf@1.5.14':
|
||||
resolution: {integrity: sha512-Yb8BH/KYR7Tl+de40sZPfrqbhcU3Jlu+UPIrnXt05sjn48xqIps74Xjz8zzVp0TuHxUp8FmIGtCVhQgsbrsvvg==}
|
||||
engines: {node: '>= 10'}
|
||||
cpu: [arm]
|
||||
os: [linux]
|
||||
|
||||
'@tauri-apps/cli-linux-arm64-gnu@1.5.14':
|
||||
resolution: {integrity: sha512-QrKHP4gRaHiup478rPBZ+BmNd88yze9jMmheoNy9mN1K/aECRmTHO+tWhsxv5moFHZzRhO0QDWxxvTtiaPXaGg==}
|
||||
engines: {node: '>= 10'}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@tauri-apps/cli-linux-arm64-musl@1.5.14':
|
||||
resolution: {integrity: sha512-Hb1C1VMxmUcyGjW/K/INKF87zzzgLEVRmWZZnQd7M1P4uue4xPyIwUELSdX12Z2jREPgmLW4AXPD0m6wsNu7iw==}
|
||||
engines: {node: '>= 10'}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
'@tauri-apps/cli-linux-x64-gnu@1.5.14':
|
||||
resolution: {integrity: sha512-kD9v/UwPDuhIgq2TJj/s2/7rqk+vmExVV6xHPKI8vVbIvlNAOZqmx3fpxjej1241vhJ/piGd/m6q6YMWGsL0oQ==}
|
||||
engines: {node: '>= 10'}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@tauri-apps/cli-linux-x64-musl@1.5.14':
|
||||
resolution: {integrity: sha512-204Drgg9Zx0+THKndqASz4+iPCwqA3gQVF9C0CDIArNXrjPyJjVvW8VP5CHiZYaTNWxlz/ltyxluM6UFWbXNFw==}
|
||||
engines: {node: '>= 10'}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
'@tauri-apps/cli-win32-arm64-msvc@1.5.14':
|
||||
resolution: {integrity: sha512-sqPSni2MnWNCm+8YZnLdWCclxfSHaYqKuPFSz8q7Tn1G1m/cA9gyPoC1G0esHftY7bu/ZM5lB4kM3I4U0KlLiA==}
|
||||
engines: {node: '>= 10'}
|
||||
cpu: [arm64]
|
||||
os: [win32]
|
||||
|
||||
'@tauri-apps/cli-win32-ia32-msvc@1.5.14':
|
||||
resolution: {integrity: sha512-8xN8W0zTs8oFsQmvYLxHFeqhzVI7oTaPK1xQMc5gbpFP45jN41c21aCXfjnvzT+h90EfCHUF9EWj2HTEJSb7Iw==}
|
||||
engines: {node: '>= 10'}
|
||||
cpu: [ia32]
|
||||
os: [win32]
|
||||
|
||||
'@tauri-apps/cli-win32-x64-msvc@1.5.14':
|
||||
resolution: {integrity: sha512-U0slee5tNM2PYECBpPHavLSwkT3szGMZ+qhcikQQbDan84bQdLn/kHWjyXOgLJs4KSve4+KxcrN+AVqj0VyHnw==}
|
||||
engines: {node: '>= 10'}
|
||||
cpu: [x64]
|
||||
os: [win32]
|
||||
|
||||
'@tauri-apps/cli@1.5.14':
|
||||
resolution: {integrity: sha512-JOSMKymlg116UdEXSj69eg5p1OtZnQkUE0qIGbtNDO1sk3X/KgBN6+oHBW0BzPStp/W0AjBgrMWCqjHPwEpOug==}
|
||||
'@tauri-apps/cli@2.0.0-beta.21':
|
||||
resolution: {integrity: sha512-lqV4pD0iTs8ASd19slH0eRoVAjbxtD0cCsZFVD7kG4sYkeZ0IkvtxbvnHAOUbALfvnHZr1dVXFDVxQUqJK2OXw==}
|
||||
engines: {node: '>= 10'}
|
||||
hasBin: true
|
||||
|
||||
'@tauri-apps/plugin-log@git+https://git@github.com:tauri-apps/tauri-plugin-log.git#2ca437c04b617664350609a0006089b63581fbec':
|
||||
resolution: {commit: 2ca437c04b617664350609a0006089b63581fbec, repo: git@github.com:tauri-apps/tauri-plugin-log.git, type: git}
|
||||
version: 2.0.0-beta.6
|
||||
|
||||
'@tauri-apps/plugin-shell@2.0.0-beta.6':
|
||||
resolution: {integrity: sha512-g3nM9cQQGl7Iv4MvyFuco/aPTiwOI/MixcoKso3VQIg5Aqd64NqR0r+GfsB0qx52txItqzSXwmeaj1eZjO9Q6Q==}
|
||||
|
||||
'@tauri-apps/plugin-sql@git+https://git@github.com:tauri-apps/tauri-plugin-sql.git#4dde23a4fdaec61f538aa784922d8b74d1ff1c0c':
|
||||
resolution: {commit: 4dde23a4fdaec61f538aa784922d8b74d1ff1c0c, repo: git@github.com:tauri-apps/tauri-plugin-sql.git, type: git}
|
||||
version: 2.0.0-beta.5
|
||||
|
||||
'@types/color-convert@2.0.3':
|
||||
resolution: {integrity: sha512-2Q6wzrNiuEvYxVQqhh7sXM2mhIhvZR/Paq4FdsQkOMgWsCIkKvSGj8Le1/XalulrmgOzPMqNa0ix+ePY4hTrfg==}
|
||||
|
||||
@@ -2554,14 +2504,6 @@ packages:
|
||||
resolution: {integrity: sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==}
|
||||
engines: {node: '>=6'}
|
||||
|
||||
tauri-plugin-log-api@https://codeload.github.com/tauri-apps/tauri-plugin-log/tar.gz/752531f21f626c9f9f1716a28c4a37054c679657:
|
||||
resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-log/tar.gz/752531f21f626c9f9f1716a28c4a37054c679657}
|
||||
version: 0.0.0
|
||||
|
||||
tauri-plugin-sql-api@https://codeload.github.com/tauri-apps/tauri-plugin-sql/tar.gz/fe26880383d97d28ab0cc339773e75ce80730ced:
|
||||
resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-sql/tar.gz/fe26880383d97d28ab0cc339773e75ce80730ced}
|
||||
version: 0.0.0
|
||||
|
||||
text-segmentation@1.0.3:
|
||||
resolution: {integrity: sha512-iOiPUo/BGnZ6+54OsWxZidGCsdU8YbE4PSpdPinp7DeMtUJNJBoJ/ouUSTJjHkh1KntHaltHl/gDs2FC4i5+Nw==}
|
||||
|
||||
@@ -3353,52 +3295,23 @@ snapshots:
|
||||
'@rollup/rollup-win32-x64-msvc@4.14.3':
|
||||
optional: true
|
||||
|
||||
'@tauri-apps/api@1.5.3': {}
|
||||
'@tauri-apps/api@2.0.0-beta.13': {}
|
||||
|
||||
'@tauri-apps/api@1.5.6': {}
|
||||
'@tauri-apps/api@2.0.0-beta.14': {}
|
||||
|
||||
'@tauri-apps/cli-darwin-arm64@1.5.14':
|
||||
optional: true
|
||||
'@tauri-apps/cli@2.0.0-beta.21': {}
|
||||
|
||||
'@tauri-apps/cli-darwin-x64@1.5.14':
|
||||
optional: true
|
||||
'@tauri-apps/plugin-log@git+https://git@github.com:tauri-apps/tauri-plugin-log.git#2ca437c04b617664350609a0006089b63581fbec':
|
||||
dependencies:
|
||||
'@tauri-apps/api': 2.0.0-beta.13
|
||||
|
||||
'@tauri-apps/cli-linux-arm-gnueabihf@1.5.14':
|
||||
optional: true
|
||||
'@tauri-apps/plugin-shell@2.0.0-beta.6':
|
||||
dependencies:
|
||||
'@tauri-apps/api': 2.0.0-beta.13
|
||||
|
||||
'@tauri-apps/cli-linux-arm64-gnu@1.5.14':
|
||||
optional: true
|
||||
|
||||
'@tauri-apps/cli-linux-arm64-musl@1.5.14':
|
||||
optional: true
|
||||
|
||||
'@tauri-apps/cli-linux-x64-gnu@1.5.14':
|
||||
optional: true
|
||||
|
||||
'@tauri-apps/cli-linux-x64-musl@1.5.14':
|
||||
optional: true
|
||||
|
||||
'@tauri-apps/cli-win32-arm64-msvc@1.5.14':
|
||||
optional: true
|
||||
|
||||
'@tauri-apps/cli-win32-ia32-msvc@1.5.14':
|
||||
optional: true
|
||||
|
||||
'@tauri-apps/cli-win32-x64-msvc@1.5.14':
|
||||
optional: true
|
||||
|
||||
'@tauri-apps/cli@1.5.14':
|
||||
optionalDependencies:
|
||||
'@tauri-apps/cli-darwin-arm64': 1.5.14
|
||||
'@tauri-apps/cli-darwin-x64': 1.5.14
|
||||
'@tauri-apps/cli-linux-arm-gnueabihf': 1.5.14
|
||||
'@tauri-apps/cli-linux-arm64-gnu': 1.5.14
|
||||
'@tauri-apps/cli-linux-arm64-musl': 1.5.14
|
||||
'@tauri-apps/cli-linux-x64-gnu': 1.5.14
|
||||
'@tauri-apps/cli-linux-x64-musl': 1.5.14
|
||||
'@tauri-apps/cli-win32-arm64-msvc': 1.5.14
|
||||
'@tauri-apps/cli-win32-ia32-msvc': 1.5.14
|
||||
'@tauri-apps/cli-win32-x64-msvc': 1.5.14
|
||||
'@tauri-apps/plugin-sql@git+https://git@github.com:tauri-apps/tauri-plugin-sql.git#4dde23a4fdaec61f538aa784922d8b74d1ff1c0c':
|
||||
dependencies:
|
||||
'@tauri-apps/api': 2.0.0-beta.13
|
||||
|
||||
'@types/color-convert@2.0.3':
|
||||
dependencies:
|
||||
@@ -5354,14 +5267,6 @@ snapshots:
|
||||
|
||||
tapable@2.2.1: {}
|
||||
|
||||
tauri-plugin-log-api@https://codeload.github.com/tauri-apps/tauri-plugin-log/tar.gz/752531f21f626c9f9f1716a28c4a37054c679657:
|
||||
dependencies:
|
||||
'@tauri-apps/api': 1.5.3
|
||||
|
||||
tauri-plugin-sql-api@https://codeload.github.com/tauri-apps/tauri-plugin-sql/tar.gz/fe26880383d97d28ab0cc339773e75ce80730ced:
|
||||
dependencies:
|
||||
'@tauri-apps/api': 1.5.3
|
||||
|
||||
text-segmentation@1.0.3:
|
||||
dependencies:
|
||||
utrie: 1.0.2
|
||||
|
||||
1968
src-tauri/Cargo.lock
generated
1968
src-tauri/Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -10,32 +10,33 @@ edition = "2021"
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[build-dependencies]
|
||||
tauri-build = { version = "1.5.2", features = [] }
|
||||
tauri-build = { version = "2.0.0-beta.18", features = [] }
|
||||
|
||||
[dependencies]
|
||||
chrono = "0.4.38"
|
||||
log = "0.4.21"
|
||||
serde = { version = "1.0.203", features = ["derive"] }
|
||||
serde_json = "1.0.117"
|
||||
tauri = { version = "1.6.8", features = [ "shell-execute", "shell-open", "window-set-always-on-top", "window-set-fullscreen", "dialog-message", "process-exit", "fs-read-dir", "window-hide", "os-all", "clipboard-all", "dialog-open", "dialog-save", "fs-create-dir", "fs-remove-dir", "fs-write-file", "fs-remove-file", "fs-read-file", "path-all", "fs-exists", "window-close", "window-set-title", "window-unminimize", "window-show", "window-set-focus", "http-request"] }
|
||||
tauri-utils = "1.5.4"
|
||||
tauri = "2.0.0-beta.23"
|
||||
tauri-utils = "2.0.0-beta.18"
|
||||
url = "2.5.1"
|
||||
walkdir = "2.5.0"
|
||||
|
||||
# sqlite 插件
|
||||
[dependencies.tauri-plugin-sql]
|
||||
git = "https://github.com/tauri-apps/plugins-workspace"
|
||||
branch = "v1"
|
||||
branch = "v2"
|
||||
features = ["sqlite"]
|
||||
|
||||
# deep link 插件
|
||||
[dependencies.tauri-plugin-deep-link]
|
||||
version = "0.1.2"
|
||||
git = "https://github.com/tauri-apps/plugins-workspace"
|
||||
branch = "v2"
|
||||
|
||||
# log 插件
|
||||
[dependencies.tauri-plugin-log]
|
||||
git = "https://github.com/tauri-apps/plugins-workspace"
|
||||
branch = "v1"
|
||||
branch = "v2"
|
||||
|
||||
[features]
|
||||
# this feature is used for production builds or when `devPath` points to the filesystem
|
||||
|
||||
1
src-tauri/gen/schemas/acl-manifests.json
Normal file
1
src-tauri/gen/schemas/acl-manifests.json
Normal file
File diff suppressed because one or more lines are too long
1
src-tauri/gen/schemas/capabilities.json
Normal file
1
src-tauri/gen/schemas/capabilities.json
Normal file
@@ -0,0 +1 @@
|
||||
{}
|
||||
2329
src-tauri/gen/schemas/desktop-schema.json
Normal file
2329
src-tauri/gen/schemas/desktop-schema.json
Normal file
File diff suppressed because it is too large
Load Diff
2329
src-tauri/gen/schemas/windows-schema.json
Normal file
2329
src-tauri/gen/schemas/windows-schema.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,11 +1,13 @@
|
||||
//! @file src/client/menu.rs
|
||||
//! @desc 客户端菜单模块,负责操作米游社客户端菜单
|
||||
//! @since Beta v0.4.5
|
||||
//! @since Beta v0.4.10
|
||||
|
||||
use tauri::{AppHandle, CustomMenuItem, LogicalSize, Manager, Menu, Size, Submenu, WindowUrl};
|
||||
use tauri::menu::{Menu, MenuBuilder, MenuEvent, MenuItemBuilder, Submenu, SubmenuBuilder};
|
||||
use tauri::{AppHandle, LogicalSize, Manager, Size, Window, Wry};
|
||||
use tauri_utils::config::WebviewUrl;
|
||||
use url::Url;
|
||||
|
||||
pub fn get_mhy_client_url(func: String) -> WindowUrl {
|
||||
pub fn get_mhy_client_url(func: String) -> WebviewUrl {
|
||||
let mut url_res: Url = "https://bbs.mihoyo.com/ys/".parse().unwrap();
|
||||
if func == "sign_in" {
|
||||
url_res = "https://webstatic.mihoyo.com/bbs/event/signin-ys/index.html?act_id=e202009291139501"
|
||||
@@ -13,82 +15,87 @@ pub fn get_mhy_client_url(func: String) -> WindowUrl {
|
||||
.unwrap();
|
||||
} else if func == "game_record" {
|
||||
url_res =
|
||||
"https://webstatic.mihoyo.com/app/community-game-records/index.html?bbs_presentation_style=fullscreen".parse().unwrap();
|
||||
"https://webstatic.mihoyo.com/app/community-game-records/index.html?bbs_presentation_style=fullscreen".parse().unwrap();
|
||||
} else if func == "birthday" {
|
||||
url_res = "https://webstatic.mihoyo.com/ys/event/e20220303-birthday/index.html?activity_id=20220301153521"
|
||||
.parse()
|
||||
.unwrap();
|
||||
.parse()
|
||||
.unwrap();
|
||||
}
|
||||
return WindowUrl::External(url_res);
|
||||
return WebviewUrl::External(url_res);
|
||||
}
|
||||
|
||||
// 创建子菜单-工具
|
||||
fn create_utils_menu() -> Menu {
|
||||
let retry_bridge = CustomMenuItem::new("retry".to_string(), "重试桥接");
|
||||
let mock_touch = CustomMenuItem::new("mock_touch".to_string(), "模拟触摸");
|
||||
let remove_overlay = CustomMenuItem::new("remove_overlay".to_string(), "移除遮罩");
|
||||
let rotate_window = CustomMenuItem::new("rotate_window".to_string(), "旋转窗口");
|
||||
let switch_ua = CustomMenuItem::new("switch_ua".to_string(), "切换 UA");
|
||||
return Menu::new()
|
||||
.add_item(retry_bridge)
|
||||
.add_item(mock_touch)
|
||||
.add_item(remove_overlay)
|
||||
.add_item(rotate_window);
|
||||
fn create_utils_menu(app: AppHandle) -> Submenu<Wry> {
|
||||
let retry_bridge_submenu = MenuItemBuilder::with_id("retry", "重试桥接").build(&app).unwrap();
|
||||
let mock_touch_submenu = MenuItemBuilder::with_id("mock_touch", "模拟触摸").build(&app).unwrap();
|
||||
let remove_overlay_submenu =
|
||||
MenuItemBuilder::with_id("remove_overlay", "移除遮罩").build(&app).unwrap();
|
||||
let rotate_window_submenu =
|
||||
MenuItemBuilder::with_id("rotate_window", "旋转窗口").build(&app).unwrap();
|
||||
let utils_menu = SubmenuBuilder::new(&app, "工具")
|
||||
.item(&retry_bridge_submenu)
|
||||
.item(&mock_touch_submenu)
|
||||
.item(&remove_overlay_submenu)
|
||||
.item(&rotate_window_submenu)
|
||||
.build()
|
||||
.expect("failed to create utils_menu");
|
||||
return utils_menu;
|
||||
}
|
||||
|
||||
// 创建米游社客户端菜单
|
||||
pub fn create_mhy_menu(func: String) -> Menu {
|
||||
let top = CustomMenuItem::new("top".to_string(), "置顶");
|
||||
let cancel_top = CustomMenuItem::new("cancel_top".to_string(), "取消置顶");
|
||||
let sign_in = CustomMenuItem::new("sign_in".to_string(), "用户登录");
|
||||
let open_post = CustomMenuItem::new("open_post".to_string(), "打开帖子");
|
||||
let utils_menu = Submenu::new("工具".to_string(), create_utils_menu());
|
||||
pub fn create_mhy_menu(func: String, app: AppHandle) -> Menu<Wry> {
|
||||
let top_menu = MenuItemBuilder::with_id("top", "置顶").build(&app).unwrap();
|
||||
let cancel_top_menu = MenuItemBuilder::with_id("cancel_top", "取消置顶").build(&app).unwrap();
|
||||
let sign_in_menu = MenuItemBuilder::with_id("sign_in", "用户登录").build(&app).unwrap();
|
||||
let open_post_menu = MenuItemBuilder::with_id("open_post", "打开帖子").build(&app).unwrap();
|
||||
let utils_menu = create_utils_menu(app.clone());
|
||||
// 如果是登录
|
||||
if func == "config_sign_in" {
|
||||
return Menu::new().add_item(sign_in);
|
||||
return MenuBuilder::new(&app).item(&sign_in_menu).build().expect("failed to create mhy_menu");
|
||||
}
|
||||
return Menu::new()
|
||||
.add_item(top)
|
||||
.add_item(cancel_top)
|
||||
.add_item(open_post)
|
||||
.add_submenu(utils_menu);
|
||||
return MenuBuilder::new(&app)
|
||||
.item(&top_menu)
|
||||
.item(&cancel_top_menu)
|
||||
.item(&open_post_menu)
|
||||
.item(&utils_menu)
|
||||
.build()
|
||||
.expect("failed to create mhy_menu");
|
||||
}
|
||||
|
||||
// 菜单栏事件处理
|
||||
pub fn handle_menu_event(app_handle: AppHandle, event: tauri::MenuEvent) {
|
||||
match event.menu_item_id() {
|
||||
"top" => handle_menu_top(app_handle),
|
||||
"cancel_top" => handle_menu_cancel_top(app_handle),
|
||||
"sign_in" => handle_menu_sign_in(app_handle),
|
||||
"open_post" => handle_menu_open_post(app_handle),
|
||||
"retry" => handle_menu_retry(app_handle),
|
||||
"mock_touch" => handle_menu_mock_touch(app_handle),
|
||||
"remove_overlay" => handle_menu_remove_overlay(app_handle),
|
||||
"rotate_window" => handle_menu_rotate_window(app_handle),
|
||||
"switch_ua" => handle_menu_switch_ua(app_handle),
|
||||
pub fn handle_menu_event(window: &Window, event: MenuEvent) {
|
||||
match event.id.as_ref() {
|
||||
"top" => handle_menu_top(window),
|
||||
"cancel_top" => handle_menu_cancel_top(window),
|
||||
"sign_in" => handle_menu_sign_in(window),
|
||||
"open_post" => handle_menu_open_post(window),
|
||||
"retry" => handle_menu_retry(window),
|
||||
"mock_touch" => handle_menu_mock_touch(window),
|
||||
"remove_overlay" => handle_menu_remove_overlay(window),
|
||||
"rotate_window" => handle_menu_rotate_window(window),
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
// 处理置顶菜单
|
||||
fn handle_menu_top(app_handle: AppHandle) {
|
||||
let window = app_handle.get_window("mhy_client");
|
||||
fn handle_menu_top(app_handle: &Window) {
|
||||
let window = app_handle.get_webview_window("mhy_client");
|
||||
if window.is_some() {
|
||||
window.unwrap().set_always_on_top(true).unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
// 处理取消置顶菜单
|
||||
fn handle_menu_cancel_top(app_handle: AppHandle) {
|
||||
let window = app_handle.get_window("mhy_client");
|
||||
fn handle_menu_cancel_top(app_handle: &Window) {
|
||||
let window = app_handle.get_webview_window("mhy_client");
|
||||
if window.is_some() {
|
||||
window.unwrap().set_always_on_top(false).unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
// 处理用户登录菜单
|
||||
fn handle_menu_sign_in(app_handle: AppHandle) {
|
||||
let window = app_handle.get_window("mhy_client");
|
||||
fn handle_menu_sign_in(app_handle: &Window) {
|
||||
let window = app_handle.get_webview_window("mhy_client");
|
||||
let execute_js = r#"
|
||||
javascript:(async function(){
|
||||
// 首先检测是不是 user.mihoyo.com
|
||||
@@ -110,8 +117,8 @@ fn handle_menu_sign_in(app_handle: AppHandle) {
|
||||
}
|
||||
|
||||
// 处理打开帖子菜单
|
||||
fn handle_menu_open_post(app_handle: AppHandle) {
|
||||
let window = app_handle.get_window("mhy_client");
|
||||
fn handle_menu_open_post(app_handle: &Window) {
|
||||
let window = app_handle.get_webview_window("mhy_client");
|
||||
let execute_js = r#"
|
||||
javascript:(async function(){
|
||||
let url = new URL(window.location.href);
|
||||
@@ -150,8 +157,8 @@ fn handle_menu_open_post(app_handle: AppHandle) {
|
||||
}
|
||||
|
||||
// 处理重试桥接菜单
|
||||
fn handle_menu_retry(app_handle: AppHandle) {
|
||||
let window = app_handle.get_window("mhy_client");
|
||||
fn handle_menu_retry(app_handle: &Window) {
|
||||
let window = app_handle.get_webview_window("mhy_client");
|
||||
let execute_js = r#"
|
||||
javascript:(async function(){
|
||||
const arg = {
|
||||
@@ -165,8 +172,8 @@ fn handle_menu_retry(app_handle: AppHandle) {
|
||||
}
|
||||
|
||||
// 处理模拟触摸菜单
|
||||
fn handle_menu_mock_touch(app_handle: AppHandle) {
|
||||
let window = app_handle.get_window("mhy_client");
|
||||
fn handle_menu_mock_touch(app_handle: &Window) {
|
||||
let window = app_handle.get_webview_window("mhy_client");
|
||||
let execute_js = r#"
|
||||
javascript:(async function(){
|
||||
const arg = {
|
||||
@@ -180,8 +187,8 @@ fn handle_menu_mock_touch(app_handle: AppHandle) {
|
||||
}
|
||||
|
||||
// 处理移除遮罩菜单
|
||||
fn handle_menu_remove_overlay(app_handle: AppHandle) {
|
||||
let window = app_handle.get_window("mhy_client");
|
||||
fn handle_menu_remove_overlay(app_handle: &Window) {
|
||||
let window = app_handle.get_webview_window("mhy_client");
|
||||
let execute_js = r#"
|
||||
javascript:(async function(){
|
||||
const arg = {
|
||||
@@ -195,8 +202,8 @@ fn handle_menu_remove_overlay(app_handle: AppHandle) {
|
||||
}
|
||||
|
||||
// 处理旋转窗口菜单
|
||||
fn handle_menu_rotate_window(app_handle: AppHandle) {
|
||||
let window_get = app_handle.get_window("mhy_client");
|
||||
fn handle_menu_rotate_window(app_handle: &Window) {
|
||||
let window_get = app_handle.get_webview_window("mhy_client");
|
||||
if window_get == None {
|
||||
return;
|
||||
}
|
||||
@@ -211,23 +218,3 @@ fn handle_menu_rotate_window(app_handle: AppHandle) {
|
||||
window.center().unwrap();
|
||||
window.set_focus().unwrap();
|
||||
}
|
||||
|
||||
// 处理切换 UA 菜单
|
||||
fn handle_menu_switch_ua(app_handle: AppHandle) {
|
||||
let window = app_handle.get_window("mhy_client");
|
||||
let execute_js = r#"
|
||||
javascript:(async function(){
|
||||
const isPc = navigator.userAgent.includes("Windows NT");
|
||||
const arg = {
|
||||
method: 'teyvat_switch_ua',
|
||||
payload: {
|
||||
url: window.location.href,
|
||||
isPc,
|
||||
}
|
||||
}
|
||||
await window.__TAURI__.event.emit('post_mhy_client',JSON.stringify(arg));
|
||||
})()"#;
|
||||
if window.is_some() {
|
||||
window.unwrap().eval(&execute_js).ok().unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,25 +1,21 @@
|
||||
//! @file src/client/mod.rs
|
||||
//! @desc 客户端模块,负责操作米游社客户端
|
||||
//! @since Beta v0.4.5
|
||||
//! @since Beta v0.4.10
|
||||
|
||||
mod menu;
|
||||
use tauri::async_runtime::block_on;
|
||||
use tauri::{AppHandle, Manager, WindowBuilder, WindowEvent, WindowUrl};
|
||||
use tauri::{AppHandle, Manager, WebviewWindowBuilder, WindowEvent};
|
||||
use tauri_utils::config::WebviewUrl;
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn create_mhy_client(handle: AppHandle, func: String, url: String) {
|
||||
let mut mhy_window_config = handle.config().tauri.windows.get(1).unwrap().clone();
|
||||
let mut mhy_window_config = handle.config().app.windows.get(1).unwrap().clone();
|
||||
mhy_window_config.visible = true;
|
||||
if url != "" {
|
||||
mhy_window_config.url = WindowUrl::External(url.parse().unwrap());
|
||||
mhy_window_config.url = WebviewUrl::External(url.parse().unwrap());
|
||||
} else {
|
||||
mhy_window_config.url = menu::get_mhy_client_url(func.clone());
|
||||
}
|
||||
// if pc {
|
||||
// let user_agent = mhy_window_config.user_agent.as_ref().unwrap();
|
||||
// let version = user_agent.split("/").last().unwrap();
|
||||
// mhy_window_config.user_agent = Some(format!("Mozilla/5.0 (Windows NT 10.0; Win64; x64) miHoYoBBS/{}", version));
|
||||
// }
|
||||
if func == "birthday"
|
||||
|| func == "web_act"
|
||||
|| url.starts_with("https://webstatic.mihoyo.com/ys/event/e20220303-birthday/index.html")
|
||||
@@ -27,7 +23,7 @@ pub async fn create_mhy_client(handle: AppHandle, func: String, url: String) {
|
||||
mhy_window_config.width = 1280.0;
|
||||
mhy_window_config.height = 720.0;
|
||||
}
|
||||
let window_get = handle.get_window("mhy_client");
|
||||
let window_get = handle.get_webview_window("mhy_client");
|
||||
if window_get.is_some() {
|
||||
let mhy_client = window_get.unwrap();
|
||||
mhy_client.on_window_event(move |e| {
|
||||
@@ -39,9 +35,10 @@ pub async fn create_mhy_client(handle: AppHandle, func: String, url: String) {
|
||||
mhy_client.close().unwrap();
|
||||
return;
|
||||
}
|
||||
WindowBuilder::from_config(&handle, mhy_window_config)
|
||||
.menu(menu::create_mhy_menu(func))
|
||||
.build()
|
||||
WebviewWindowBuilder::from_config(&handle, &mhy_window_config)
|
||||
.expect("failed to create mhy_client")
|
||||
.on_menu_event(move |event| menu::handle_menu_event(handle.clone(), event));
|
||||
.menu(menu::create_mhy_menu(func.clone(), handle.clone()))
|
||||
.build()
|
||||
.expect("failed to add menu")
|
||||
.on_menu_event(move |app, event| menu::handle_menu_event(app, event));
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
//! @file src/commands.rs
|
||||
//! @desc 命令模块,负责处理命令
|
||||
//! @since Beta v0.4.3
|
||||
//! @since Beta v0.4.10
|
||||
|
||||
use tauri::{Manager, WindowBuilder};
|
||||
use tauri::{Manager, WebviewWindowBuilder};
|
||||
use tauri_utils::config::WindowConfig;
|
||||
|
||||
// 放一个常数,用来判断应用是否初始化
|
||||
@@ -18,40 +18,21 @@ pub async fn init_app(app_handle: tauri::AppHandle) {
|
||||
}
|
||||
}
|
||||
dbg!("init_app");
|
||||
let _mhy = app_handle.get_window("mhy_client");
|
||||
let _mhy = app_handle.get_webview_window("mhy_client");
|
||||
if _mhy.is_some() {
|
||||
std::thread::sleep(std::time::Duration::from_millis(1000));
|
||||
_mhy.unwrap().close().unwrap();
|
||||
}
|
||||
app_handle.emit_all("initApp", ()).unwrap();
|
||||
app_handle.emit("initApp", ()).unwrap();
|
||||
unsafe {
|
||||
APP_INITIALIZED = true;
|
||||
}
|
||||
}
|
||||
|
||||
// 注册deep link
|
||||
#[tauri::command]
|
||||
pub async fn register_deep_link(app_handle: tauri::AppHandle) {
|
||||
unsafe {
|
||||
if DEEP_LINK_REGISTERED == true {
|
||||
return;
|
||||
}
|
||||
}
|
||||
dbg!("register_deep_link");
|
||||
tauri_plugin_deep_link::register("teyvatguide", move |request| {
|
||||
dbg!(&request);
|
||||
app_handle.emit_all("active_deep_link", request).unwrap();
|
||||
})
|
||||
.unwrap();
|
||||
unsafe {
|
||||
DEEP_LINK_REGISTERED = true;
|
||||
}
|
||||
}
|
||||
|
||||
// 创建窗口
|
||||
#[tauri::command]
|
||||
pub async fn create_window(app_handle: tauri::AppHandle, label: String, mut option: WindowConfig) {
|
||||
let window_old = app_handle.get_window(&label);
|
||||
let window_old = app_handle.get_webview_window(&label);
|
||||
option.label = label.clone();
|
||||
if window_old.is_some() {
|
||||
dbg!("window exists");
|
||||
@@ -59,14 +40,14 @@ pub async fn create_window(app_handle: tauri::AppHandle, label: String, mut opti
|
||||
return;
|
||||
}
|
||||
let window_new =
|
||||
Some(WindowBuilder::from_config(&app_handle, option).build().expect("failed to create window"));
|
||||
Some(WebviewWindowBuilder::from_config(&app_handle, &option).expect("failed to create window"));
|
||||
window_new.unwrap();
|
||||
}
|
||||
|
||||
// 执行 js
|
||||
#[tauri::command]
|
||||
pub async fn execute_js(app_handle: tauri::AppHandle, label: String, js: String) {
|
||||
let window = app_handle.get_window(&label);
|
||||
let window = app_handle.get_webview_window(&label);
|
||||
if window.is_some() {
|
||||
window.unwrap().eval(&js).ok().unwrap();
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//! @file src/main.rs
|
||||
//! @desc 主模块,用于启动应用
|
||||
//! @since Beta v0.4.3
|
||||
//! @since Beta v0.4.10
|
||||
|
||||
// Prevents additional console window on Windows in release, DO NOT REMOVE!!
|
||||
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
||||
@@ -12,35 +12,34 @@ mod plugins;
|
||||
mod utils;
|
||||
|
||||
// 窗口事件处理
|
||||
fn window_event_handler(event: tauri::GlobalWindowEvent) -> () {
|
||||
match event.event() {
|
||||
fn window_event_handler(app: &tauri::Window, event: &tauri::WindowEvent) {
|
||||
match event {
|
||||
tauri::WindowEvent::CloseRequested { api, .. } => {
|
||||
api.prevent_close();
|
||||
let window = event.window().clone();
|
||||
if window.label() == "TeyvatGuide" {
|
||||
if app.label() == "TeyvatGuide" {
|
||||
// 子窗口 label 的数组
|
||||
const SUB_WINDOW_LABELS: [&str; 3] = ["Sub_window", "Dev_JSON", "mhy_client"];
|
||||
for label in SUB_WINDOW_LABELS.iter() {
|
||||
let sub = window.get_window(label);
|
||||
let sub = app.get_webview_window(label);
|
||||
if sub.is_some() {
|
||||
sub.unwrap().close().unwrap();
|
||||
}
|
||||
}
|
||||
}
|
||||
window.close().unwrap();
|
||||
app.close().unwrap();
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
tauri_plugin_deep_link::prepare("teyvatguide");
|
||||
tauri::Builder::default()
|
||||
.on_window_event(|event| window_event_handler(event))
|
||||
.on_window_event(move |app, event| window_event_handler(app, event))
|
||||
.plugin(plugins::build_sql_plugin())
|
||||
.plugin(plugins::build_log_plugin())
|
||||
.plugin(tauri_plugin_deep_link::init())
|
||||
.setup(|_app| {
|
||||
let _window = _app.get_window("TeyvatGuide");
|
||||
let _window = _app.get_webview_window("TeyvatGuide");
|
||||
#[cfg(debug_assertions)]
|
||||
if _window.is_some() {
|
||||
_window.unwrap().open_devtools();
|
||||
@@ -49,7 +48,6 @@ fn main() {
|
||||
})
|
||||
.invoke_handler(tauri::generate_handler![
|
||||
commands::init_app,
|
||||
commands::register_deep_link,
|
||||
commands::create_window,
|
||||
commands::execute_js,
|
||||
commands::get_dir_size,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
//! @file src/plugins.rs
|
||||
//! @desc 插件模块,用于注册插件
|
||||
//! @since Beta v0.4.4
|
||||
//! @since Beta v0.4.10
|
||||
|
||||
use super::utils;
|
||||
use log::LevelFilter;
|
||||
use tauri::plugin::TauriPlugin;
|
||||
use tauri::Runtime;
|
||||
use tauri_plugin_log::{LogTarget, TimezoneStrategy};
|
||||
use tauri_plugin_log::{Target, TargetKind, TimezoneStrategy};
|
||||
use tauri_plugin_sql::PluginConfig;
|
||||
|
||||
// sqlite 插件
|
||||
@@ -18,15 +18,17 @@ pub fn build_sql_plugin<R: Runtime>() -> TauriPlugin<R, Option<PluginConfig>> {
|
||||
pub fn build_log_plugin<R: Runtime>() -> TauriPlugin<R> {
|
||||
if cfg!(debug_assertions) {
|
||||
return tauri_plugin_log::Builder::default()
|
||||
.targets([LogTarget::Stdout])
|
||||
.targets([Target::new(TargetKind::Webview)])
|
||||
.timezone_strategy(TimezoneStrategy::UseLocal)
|
||||
.level(LevelFilter::Debug)
|
||||
.build();
|
||||
}
|
||||
return tauri_plugin_log::Builder::default()
|
||||
.targets([LogTarget::LogDir, LogTarget::Stdout])
|
||||
.targets([
|
||||
Target::new(TargetKind::Webview),
|
||||
Target::new(TargetKind::LogDir { file_name: utils::get_current_date().into() }),
|
||||
])
|
||||
.timezone_strategy(TimezoneStrategy::UseLocal)
|
||||
.level(LevelFilter::Info)
|
||||
.log_name(utils::get_current_date())
|
||||
.build();
|
||||
}
|
||||
|
||||
@@ -1,159 +1,45 @@
|
||||
{
|
||||
"productName": "TeyvatGuide",
|
||||
"version": "0.4.9",
|
||||
"build": {
|
||||
"beforeDevCommand": "pnpm vite:dev",
|
||||
"beforeBuildCommand": "pnpm vite:build",
|
||||
"devPath": "http://localhost:4000",
|
||||
"distDir": "../dist",
|
||||
"withGlobalTauri": true
|
||||
"devUrl": "http://localhost:4000",
|
||||
"frontendDist": "../dist"
|
||||
},
|
||||
"package": {
|
||||
"productName": "TeyvatGuide",
|
||||
"version": "0.4.9"
|
||||
},
|
||||
"tauri": {
|
||||
"allowlist": {
|
||||
"all": false,
|
||||
"fs": {
|
||||
"all": false,
|
||||
"exists": true,
|
||||
"readFile": true,
|
||||
"readDir": true,
|
||||
"writeFile": true,
|
||||
"createDir": true,
|
||||
"removeDir": true,
|
||||
"removeFile": true,
|
||||
"scope": ["**", "**/*"]
|
||||
},
|
||||
"http": {
|
||||
"all": false,
|
||||
"request": true,
|
||||
"scope": ["http://**", "https://**"]
|
||||
},
|
||||
"dialog": {
|
||||
"all": false,
|
||||
"open": true,
|
||||
"save": true,
|
||||
"message": true
|
||||
},
|
||||
"clipboard": {
|
||||
"all": true
|
||||
},
|
||||
"path": {
|
||||
"all": true
|
||||
},
|
||||
"window": {
|
||||
"all": false,
|
||||
"close": true,
|
||||
"hide": true,
|
||||
"setAlwaysOnTop": true,
|
||||
"setFocus": true,
|
||||
"setFullscreen": true,
|
||||
"setTitle": true,
|
||||
"show": true,
|
||||
"unminimize": true
|
||||
},
|
||||
"os": {
|
||||
"all": true
|
||||
},
|
||||
"process": {
|
||||
"all": false,
|
||||
"exit": true
|
||||
},
|
||||
"shell": {
|
||||
"all": false,
|
||||
"open": true,
|
||||
"execute": true,
|
||||
"scope": [
|
||||
{
|
||||
"name": "win_open",
|
||||
"cmd": "explorer",
|
||||
"args": true
|
||||
},
|
||||
{
|
||||
"name": "mac_open",
|
||||
"cmd": "open",
|
||||
"args": true
|
||||
}
|
||||
]
|
||||
"bundle": {
|
||||
"active": true,
|
||||
"icon": [
|
||||
"icons/128x128.png",
|
||||
"icons/128x128@2x.png",
|
||||
"icons/32x32.png",
|
||||
"icons/Square107x107Logo.png",
|
||||
"icons/Square142x142Logo.png",
|
||||
"icons/Square150x150Logo.png",
|
||||
"icons/Square284x284Logo.png",
|
||||
"icons/Square30x30Logo.png",
|
||||
"icons/Square310x310Logo.png",
|
||||
"icons/Square44x44Logo.png",
|
||||
"icons/Square71x71Logo.png",
|
||||
"icons/Square89x89Logo.png",
|
||||
"icons/StoreLogo.png",
|
||||
"icons/icon.ico",
|
||||
"icons/icon.png"
|
||||
],
|
||||
"targets": [
|
||||
"msi",
|
||||
"app",
|
||||
"dmg"
|
||||
],
|
||||
"windows": {
|
||||
"wix": {
|
||||
"language": "zh-CN"
|
||||
}
|
||||
},
|
||||
"bundle": {
|
||||
"active": true,
|
||||
"icon": [
|
||||
"icons/128x128.png",
|
||||
"icons/128x128@2x.png",
|
||||
"icons/32x32.png",
|
||||
"icons/Square107x107Logo.png",
|
||||
"icons/Square142x142Logo.png",
|
||||
"icons/Square150x150Logo.png",
|
||||
"icons/Square284x284Logo.png",
|
||||
"icons/Square30x30Logo.png",
|
||||
"icons/Square310x310Logo.png",
|
||||
"icons/Square44x44Logo.png",
|
||||
"icons/Square71x71Logo.png",
|
||||
"icons/Square89x89Logo.png",
|
||||
"icons/StoreLogo.png",
|
||||
"icons/icon.ico",
|
||||
"icons/icon.png"
|
||||
],
|
||||
"identifier": "TeyvatGuide",
|
||||
"targets": ["msi", "app", "dmg"],
|
||||
"windows": {
|
||||
"wix": {
|
||||
"language": "zh-CN"
|
||||
}
|
||||
},
|
||||
"macOS": {}
|
||||
},
|
||||
"security": {
|
||||
"dangerousRemoteDomainIpcAccess": [
|
||||
{
|
||||
"domain": "act.mihoyo.com",
|
||||
"windows": ["mhy_client"],
|
||||
"enableTauriAPI": true
|
||||
},
|
||||
{
|
||||
"domain": "m.miyoushe.com",
|
||||
"windows": ["mhy_client"],
|
||||
"enableTauriAPI": true
|
||||
},
|
||||
{
|
||||
"domain": "qaa.miyoushe.com",
|
||||
"windows": ["mhy_client"],
|
||||
"enableTauriAPI": true
|
||||
},
|
||||
{
|
||||
"domain": "user.mihoyo.com",
|
||||
"windows": ["mhy_client"],
|
||||
"enableTauriAPI": true
|
||||
},
|
||||
{
|
||||
"domain": "webstatic.mihoyo.com",
|
||||
"windows": ["mhy_client"],
|
||||
"enableTauriAPI": true
|
||||
},
|
||||
{
|
||||
"domain": "bbs.mihoyo.com",
|
||||
"windows": ["mhy_client"],
|
||||
"enableTauriAPI": true
|
||||
},
|
||||
{
|
||||
"domain": "api-takumi-record.mihoyo.com",
|
||||
"windows": ["mhy_client"],
|
||||
"enableTauriAPI": true
|
||||
}
|
||||
],
|
||||
"csp": null
|
||||
},
|
||||
"updater": {
|
||||
"active": false,
|
||||
"dialog": true,
|
||||
"endpoints": [
|
||||
"https://raw.fastgit.org/BTMuli/TeyvatGuide/master/latest.json",
|
||||
"https://raw.kgithub.com/BTMuli/TeyvatGuide/master/latest.json"
|
||||
],
|
||||
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDg2MkVGRjMxQzJDQzFBNTkKUldSWkdzekNNZjh1aHJGRXBEOGtwbUxLaU1wdWNVeUJaeGhoV2ZlZ3VlYmQ0b2tYZWQwODdnTHkK"
|
||||
},
|
||||
"macOS": {}
|
||||
},
|
||||
"app": {
|
||||
"withGlobalTauri": true,
|
||||
"windows": [
|
||||
{
|
||||
"fullscreen": false,
|
||||
@@ -178,6 +64,37 @@
|
||||
"decorations": true,
|
||||
"closable": true
|
||||
}
|
||||
]
|
||||
],
|
||||
"security": {
|
||||
"capabilities": [
|
||||
{
|
||||
"identifier": "TeyvatGuide",
|
||||
"description": "米游社客户端",
|
||||
"windows": [
|
||||
"mhy_client"
|
||||
],
|
||||
"permissions": [],
|
||||
"remote": {
|
||||
"urls": [
|
||||
"https://*.mihoyo.com/*",
|
||||
"https://*.miyoushe.com/*"
|
||||
]
|
||||
},
|
||||
"platforms": [
|
||||
"windows",
|
||||
"macOS"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"plugins": {
|
||||
"deep-link": {
|
||||
"desktop": {
|
||||
"schemes": [
|
||||
"teyvatguide"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user