Parcourir la source

fix: start param error

MystiPanda il y a 1 an
Parent
commit
56078098a4
1 fichiers modifiés avec 7 ajouts et 5 suppressions
  1. 7 5
      src-tauri/src/utils/server.rs

+ 7 - 5
src-tauri/src/utils/server.rs

@@ -28,12 +28,14 @@ pub fn check_singleton() -> Result<()> {
                 let argvs: Vec<String> = std::env::args().collect();
                 if argvs.len() > 1 {
                     let param = argvs[1].as_str();
-                    reqwest::get(format!(
+                    if param.starts_with("clash:") {
+                        reqwest::get(format!(
                         "http://127.0.0.1:{port}/commands/scheme?param={param}"
-                    ))
-                    .await?
-                    .text()
-                    .await?;
+                        ))
+                        .await?
+                        .text()
+                        .await?;
+                    }
                 } else {
                     reqwest::get(format!("http://127.0.0.1:{port}/commands/visible"))
                         .await?