feat:UI及部分后端

This commit is contained in:
Tianpao
2025-09-13 21:05:14 +08:00
parent d32768afea
commit c61563c484
29 changed files with 2952 additions and 237 deletions

View File

@@ -4,11 +4,21 @@ fn greet(name: &str) -> String {
format!("Hello, {}! You've been greeted from Rust!", name)
}
#[tauri::command]
fn open_url(url: &str) {
match open::that(url) {
Err(_) => println!("Error opening url"),
Ok(_) => println!("Opened url"),
}
}
#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
tauri::Builder::default()
.plugin(tauri_plugin_store::Builder::new().build())
.plugin(tauri_plugin_opener::init())
.invoke_handler(tauri::generate_handler![greet])
.invoke_handler(tauri::generate_handler![open_url])
.run(tauri::generate_context!())
.expect("error while running tauri application");
}