feat: 完善登录保持、栅格下载和任务调度

This commit is contained in:
2026-10-25 05:42:24 +08:00
parent dab26ff4ee
commit 4cf64957c5
25 changed files with 1871 additions and 320 deletions
+13 -1
View File
@@ -27,6 +27,12 @@ fn backend_port() -> u16 {
PORT.load(Ordering::SeqCst)
}
#[tauri::command]
fn write_sample_csv(path: String) -> Result<(), String> {
let content = "\u{FEFF}20米栅格ID\r\n541927061\r\n544536471\r\n";
std::fs::write(path, content).map_err(|error| error.to_string())
}
fn repo_root() -> Option<PathBuf> {
PathBuf::from(env!("CARGO_MANIFEST_DIR"))
.parent()
@@ -115,6 +121,12 @@ fn start_backend(app: &tauri::App) {
.current_dir(&plan.cwd)
.env("NQI_PORT", port.to_string())
.env("NQI_DATA_DIR", &plan.data_dir)
.env_remove("HTTP_PROXY")
.env_remove("HTTPS_PROXY")
.env_remove("ALL_PROXY")
.env_remove("http_proxy")
.env_remove("https_proxy")
.env_remove("all_proxy")
.stdin(Stdio::null());
if let Ok(log) = std::fs::OpenOptions::new()
.create(true)
@@ -170,7 +182,7 @@ pub fn run() {
tauri::Builder::default()
.plugin(tauri_plugin_opener::init())
.plugin(tauri_plugin_dialog::init())
.invoke_handler(tauri::generate_handler![backend_port])
.invoke_handler(tauri::generate_handler![backend_port, write_sample_csv])
.setup(|app| {
start_backend(app);
Ok(())