更新依赖,增强ASR功能,优化代理路由处理,添加登录页面渲染

This commit is contained in:
2026-01-15 12:42:37 +08:00
parent 2011ea818c
commit a5ce44ba70
9 changed files with 188 additions and 82 deletions

View File

@@ -7,6 +7,7 @@ import { getToken } from '@/module/http-token.ts';
import { getTokenUserCache } from '@/routes/index.ts';
import type { WebSocketListenerFun } from "@kevisual/router";
import WebSocket from 'ws';
import { renderNoAuthAndLogin } from '@/module/assistant/html/login.ts';
const localProxy = new LocalProxy({});
localProxy.initFromAssistantConfig(assistantConfig);
@@ -161,7 +162,8 @@ export const proxyRoute = async (req: http.IncomingMessage, res: http.ServerResp
}
const filter = await authFilter(req, res);
if (filter) {
return res.end('Not Authorized Proxy');
res.writeHead(200, { 'Content-Type': 'text/html; charset=utf-8' });
return res.end(renderNoAuthAndLogin('Not Authorized Proxy'));
}
const localProxyProxyList = localProxy.getLocalProxyList();
const localProxyProxy = localProxyProxyList.find((item) => pathname.startsWith(item.path));