2026-05-12 23:19:37 +08:00
|
|
|
mod events;
|
|
|
|
|
mod models;
|
|
|
|
|
mod server;
|
|
|
|
|
mod storage;
|
2026-05-12 22:38:52 +08:00
|
|
|
|
|
|
|
|
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
|
|
|
|
pub fn run() {
|
2026-05-12 23:19:37 +08:00
|
|
|
// 在后台线程启动 HTTP 服务器
|
|
|
|
|
std::thread::spawn(|| {
|
|
|
|
|
let rt = tokio::runtime::Runtime::new().expect("无法创建 tokio runtime");
|
|
|
|
|
rt.block_on(async {
|
|
|
|
|
server::start().await;
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
2026-05-12 22:38:52 +08:00
|
|
|
tauri::Builder::default()
|
|
|
|
|
.plugin(tauri_plugin_opener::init())
|
|
|
|
|
.run(tauri::generate_context!())
|
|
|
|
|
.expect("error while running tauri application");
|
|
|
|
|
}
|