fix(service-party-app): 修复gRPC测试连接方法
将testConnection从URL解析改为直接使用host:port格式, 与grpc-client.ts的connect方法保持一致。 地址格式: mpc-grpc.szaiai.com:443 (自动检测TLS) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
2a11392ce2
commit
76ef8b0a8c
|
|
@ -223,9 +223,8 @@ function setupIpcHandlers() {
|
|||
// gRPC - 测试连接
|
||||
ipcMain.handle('grpc:testConnection', async (_event, { url }) => {
|
||||
try {
|
||||
// 解析 URL
|
||||
const urlObj = new URL(url);
|
||||
await grpcClient?.connect(urlObj.hostname, parseInt(urlObj.port) || 50051);
|
||||
// 地址格式: host:port (例如 mpc-grpc.szaiai.com:443)
|
||||
await grpcClient?.connect(url);
|
||||
return { success: true };
|
||||
} catch (error) {
|
||||
return { success: false, error: (error as Error).message };
|
||||
|
|
|
|||
Loading…
Reference in New Issue