mirror of
https://github.com/SECTL/SecScore.git
synced 2026-07-19 19:04:23 +08:00
feat: 设置页新增应用重启与退出快捷按钮
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user