mirror of
https://github.com/qingchencloud/clawpanel.git
synced 2026-05-07 04:22:42 +08:00
feat: 开机自启功能(tauri-plugin-autostart)
- Cargo.toml: 添加 tauri-plugin-autostart 依赖(桌面端) - lib.rs: 初始化 autostart 插件(MacosLauncher::LaunchAgent) - capabilities/default.json: 添加 autostart 权限 - settings.js: 面板设置新增开机自启开关(仅 Tauri 模式显示) - package.json: 添加 @tauri-apps/plugin-autostart 前端依赖
This commit is contained in:
@@ -32,3 +32,6 @@ base64 = "0.22"
|
||||
urlencoding = "2"
|
||||
regex = "1"
|
||||
tokio = { version = "1", features = ["process", "time"] }
|
||||
|
||||
[target.'cfg(any(target_os = "macos", windows, target_os = "linux"))'.dependencies]
|
||||
tauri-plugin-autostart = "2"
|
||||
|
||||
@@ -4,6 +4,9 @@
|
||||
"windows": ["main"],
|
||||
"permissions": [
|
||||
"core:default",
|
||||
"shell:allow-open"
|
||||
"shell:allow-open",
|
||||
"autostart:allow-enable",
|
||||
"autostart:allow-disable",
|
||||
"autostart:allow-is-enabled"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -15,6 +15,10 @@ pub fn run() {
|
||||
|
||||
tauri::Builder::default()
|
||||
.plugin(tauri_plugin_shell::init())
|
||||
.plugin(tauri_plugin_autostart::init(
|
||||
tauri_plugin_autostart::MacosLauncher::LaunchAgent,
|
||||
None,
|
||||
))
|
||||
.register_uri_scheme_protocol("tauri", move |ctx, request| {
|
||||
let uri_path = request.uri().path();
|
||||
let path = if uri_path == "/" || uri_path.is_empty() {
|
||||
|
||||
Reference in New Issue
Block a user