- tauri 设计完成

This commit is contained in:
Pine
2026-05-12 23:19:37 +08:00
parent c8e8dd12d2
commit 4ad266f6c4
25 changed files with 3495 additions and 3039 deletions
+12 -6
View File
@@ -1,14 +1,20 @@
// Learn more about Tauri commands at https://tauri.app/develop/calling-rust/
#[tauri::command]
fn greet(name: &str) -> String {
format!("Hello, {}! You've been greeted from Rust!", name)
}
mod events;
mod models;
mod server;
mod storage;
#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
// 在后台线程启动 HTTP 服务器
std::thread::spawn(|| {
let rt = tokio::runtime::Runtime::new().expect("无法创建 tokio runtime");
rt.block_on(async {
server::start().await;
});
});
tauri::Builder::default()
.plugin(tauri_plugin_opener::init())
.invoke_handler(tauri::generate_handler![greet])
.run(tauri::generate_context!())
.expect("error while running tauri application");
}