From 5bf14aed888cd0e258e325c65f14022dad02985b Mon Sep 17 00:00:00 2001
From: baoshiwei <baoshiwei@shlanbao.cn>
Date: 星期四, 17 七月 2025 15:32:01 +0800
Subject: [PATCH] 更改为通过websocket获取数据

---
 src/pipe_client.ts |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/src/pipe_client.ts b/src/pipe_client.ts
index a96e3cf..37b8c10 100644
--- a/src/pipe_client.ts
+++ b/src/pipe_client.ts
@@ -32,4 +32,15 @@
   
   // 鎵�鏈夐噸璇曢兘澶辫触锛屾姏鍑烘渶鍚庝竴涓敊璇�
   throw lastError;
+}
+
+export async function getLatestWsData(): Promise<string | null> {
+  try {
+    const result = await invoke<string | null>('get_latest_ws_data');
+    console.log("getlatestwsData", result);
+    return result;
+  } catch (err) {
+    console.error('鑾峰彇 WebSocket 鏁版嵁澶辫触:', err);
+    return null;
+  }
 }
\ No newline at end of file

--
Gitblit v1.9.3