diff --git a/src/modules/v1-ws-proxy/proxy.ts b/src/modules/v1-ws-proxy/proxy.ts index 755158c..fdba8e0 100644 --- a/src/modules/v1-ws-proxy/proxy.ts +++ b/src/modules/v1-ws-proxy/proxy.ts @@ -139,13 +139,14 @@ const handleRequest = async (req: IncomingMessage, res: ServerResponse, opts?: { res.end(JSON.stringify({ code: 400, message: 'newId 参数缺失' })); return; } - const wsMessage = wsProxyManager.get(newId!)!; + const realNewId = user + '--' + newId; + const wsMessage = wsProxyManager.get(realNewId!)!; if (wsMessage) { res.writeHead(400, { 'Content-Type': 'application/json' }); res.end(JSON.stringify({ code: 400, message: 'newId 已存在' })); return; } - wsProxyManager.changeId(appId, newId); + wsProxyManager.changeId(appId, realNewId); res.writeHead(200, { 'Content-Type': 'application/json' }); res.end(JSON.stringify({ code: 200, message: '应用重命名成功' })); return;