From f61604562575a34dd6091a75a55b0beed29ff6c6 Mon Sep 17 00:00:00 2001 From: abearxiong Date: Thu, 5 Feb 2026 04:50:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=94=A8=E6=88=B7=E4=BB=A3?= =?UTF-8?q?=E7=90=86=E9=80=BB=E8=BE=91=EF=BC=8C=E7=A7=BB=E9=99=A4=E9=9D=9E?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=91=98=E7=94=A8=E6=88=B7=E7=9A=84=E6=95=8F?= =?UTF-8?q?=E6=84=9F=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/ws-proxy/proxy.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/modules/ws-proxy/proxy.ts b/src/modules/ws-proxy/proxy.ts index 4016ff4..82f428f 100644 --- a/src/modules/ws-proxy/proxy.ts +++ b/src/modules/ws-proxy/proxy.ts @@ -5,6 +5,7 @@ import { App } from '@kevisual/router'; import { logger } from '../logger.ts'; import { getLoginUser } from '@/modules/auth.ts'; import { createStudioAppListHtml } from '../html/studio-app-list/index.ts'; +import { omit } from 'es-toolkit'; type ProxyOptions = { createNotFoundPage: (msg?: string) => any; @@ -74,9 +75,12 @@ export const UserV1Proxy = async (req: IncomingMessage, res: ServerResponse, opt res.end(await html); return true; } - // const { token, cookies, ...rest } = data; - const value = await client.sendData(data, { - state: { tokenUser: loginUser.tokenUser }, + let message: any = data; + if (!isAdmin) { + message = omit(data, ['token', 'cookies']); + } + const value = await client.sendData(message, { + state: { tokenUser: omit(loginUser.tokenUser, ['oauthExpand']) }, }); if (value) { res.writeHead(200, { 'Content-Type': 'application/json' });