修改数据库配置
This commit is contained in:
@@ -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![
|
||||
|
||||
Reference in New Issue
Block a user