feat: 设置页新增应用重启与退出快捷按钮

This commit is contained in:
JSR
2026-03-19 17:43:32 +08:00
parent a5149147cd
commit f9a7b27dfa
6 changed files with 112 additions and 7 deletions
+17
View File
@@ -86,3 +86,20 @@ pub async fn register_url_protocol(
Ok(IpcResponse::error("URL protocol registration is not supported on this platform"))
}
}
#[tauri::command]
pub async fn app_quit(
app: AppHandle,
_state: tauri::State<'_, Arc<RwLock<AppState>>>,
) -> Result<(), String> {
app.exit(0);
Ok(())
}
#[tauri::command]
pub async fn app_restart(
app: AppHandle,
_state: tauri::State<'_, Arc<RwLock<AppState>>>,
) -> Result<(), String> {
app.restart();
}
+2
View File
@@ -107,6 +107,8 @@ pub fn run() {
http_server_stop,
http_server_status,
register_url_protocol,
app_quit,
app_restart,
])
.run(tauri::generate_context!())
.expect("error while running tauri application");