修改数据库配置

This commit is contained in:
Yakumo Hokori
2026-02-25 22:58:50 +08:00
parent 1b36901a70
commit a89288630f
6 changed files with 327 additions and 36 deletions

View File

@@ -583,6 +583,23 @@ async fn feedback_and_close_today_workorders() -> Result<String, String> {
#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
// 首先验证配置
if let Err(e) = config::Config::load() {
// 配置加载失败,显示错误弹窗并退出
eprintln!("配置错误: {}", e);
// 使用 rfd 显示错误弹窗(阻塞模式)
rfd::MessageDialog::new()
.set_title("配置错误")
.set_description(&format!("{}\n\n软件将关闭。", e))
.set_buttons(rfd::MessageButtons::Ok)
.set_level(rfd::MessageLevel::Error)
.show();
// 用户点击确定后退出应用
std::process::exit(1);
}
tauri::Builder::default()
.plugin(tauri_plugin_opener::init())
.invoke_handler(tauri::generate_handler![