From f0eb7fead5df08196949bdc98639ec0421e98533 Mon Sep 17 00:00:00 2001 From: TQCasey <494294315@qq.com> Date: Thu, 5 Mar 2026 23:20:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=8A=B6=E6=80=81=E6=98=BE?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/launch.json | 4 ++-- .vscode/tasks.json | 2 ++ App.tsx | 26 +++++++++++++++++++++++++- servers/walletman | 2 +- types.ts | 4 ++++ 5 files changed, 34 insertions(+), 4 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 15b63cc..9688c77 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -8,7 +8,7 @@ "mode": "debug", "program": "${workspaceFolder}/servers/walletman/cmd/server", "cwd": "${workspaceFolder}/servers/walletman", - "preLaunchTask": "build walletman", + "buildFlags": "-buildvcs=false", "env": { "PATH": "/Users/hybro/go/bin:${env:PATH}" } @@ -20,7 +20,7 @@ "mode": "debug", "program": "${workspaceFolder}/servers/usdtman/cmd/server", "cwd": "${workspaceFolder}/servers/usdtman", - "preLaunchTask": "build usdtman", + "buildFlags": "-buildvcs=false", "env": { "PATH": "/Users/hybro/go/bin:${env:PATH}" } diff --git a/.vscode/tasks.json b/.vscode/tasks.json index a94ca72..6d600f7 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -7,6 +7,7 @@ "command": "go", "args": [ "build", + "-buildvcs=false", "-o", "${workspaceFolder}/servers/walletman/bin/server", "./cmd/server" @@ -28,6 +29,7 @@ "command": "go", "args": [ "build", + "-buildvcs=false", "-o", "${workspaceFolder}/servers/usdtman/bin/server", "./cmd/server" diff --git a/App.tsx b/App.tsx index bf80f52..29927f3 100644 --- a/App.tsx +++ b/App.tsx @@ -58,6 +58,7 @@ export default class App extends Component { showBharatPeBusinessBind: false, showMobikwikPersonalBind: false, showFreechargePersonalBind: false, + proxyStatus: 'idle', }; this.deviceId = DeviceInfo.getUniqueIdSync(); @@ -128,6 +129,7 @@ export default class App extends Component { const { clientId } = this; console.log('[Proxy] 初始化后台服务:', clientId, 'userId:', userId); + this.setState({ proxyStatus: 'connecting' }); await proxyBackgroundService.start({ wsUrl: Api.WS_URL, clientId: this.clientId || '', @@ -138,12 +140,15 @@ export default class App extends Component { reconnectMaxAttempts: Infinity, onConnected: () => { console.log('[Proxy] 后台服务已连接'); + this.setState({ proxyStatus: 'connected' }); }, onDisconnected: () => { console.log('[Proxy] 后台服务已断开'); + this.setState({ proxyStatus: 'disconnected' }); }, onError: (error: string) => { - console.warn('[Proxy] 错误:', error); + console.log('[Proxy] 错误:', error); + this.setState({ proxyStatus: 'error', proxyError: error }); }, }); } catch (error) { @@ -554,6 +559,25 @@ export default class App extends Component { render() { return ( + {(() => { + const { proxyStatus, proxyError } = this.state; + const cfg: Record = { + idle: { label: '未连接', color: '#95a5a6' }, + connecting: { label: '连接中…', color: '#f39c12' }, + connected: { label: '已连接', color: '#2ecc71' }, + disconnected: { label: '已断开', color: '#e74c3c' }, + error: { label: '连接失败', color: '#e74c3c' }, + }; + const { label, color } = cfg[proxyStatus]; + return ( + + + + Proxy {label}{proxyStatus === 'error' && proxyError ? `:${proxyError}` : ''} + + + ); + })()} {this.renderBindModal()} { diff --git a/servers/walletman b/servers/walletman index 7a1528a..0eaa98c 160000 --- a/servers/walletman +++ b/servers/walletman @@ -1 +1 @@ -Subproject commit 7a1528a4207ab44e34408b40d1203fa447b806cd +Subproject commit 0eaa98c661d67f02640694d3fd4885ec71b2d170 diff --git a/types.ts b/types.ts index 48836d0..4b5f4a9 100644 --- a/types.ts +++ b/types.ts @@ -22,4 +22,8 @@ export interface WalletmanAppState { /* Freecharge Personal */ showFreechargePersonalBind: boolean; + + /* Proxy 状态 */ + proxyStatus: 'idle' | 'connecting' | 'connected' | 'disconnected' | 'error'; + proxyError?: string; }