feat: update ev cli

This commit is contained in:
2025-05-18 17:59:54 +08:00
parent e9eedcd1bd
commit a05f2cd291
15 changed files with 484 additions and 585 deletions

View File

@@ -2,7 +2,7 @@ import { fileProxy, httpProxy, createApiProxy, wsProxy } from '@/module/assistan
import http from 'http';
import { LocalProxy } from './local-proxy.ts';
import { assistantConfig, app } from '@/app.ts';
import { log } from '@/module/logger.ts';
import { log, logger } from '@/module/logger.ts';
const localProxy = new LocalProxy({
assistantConfig,
});
@@ -21,6 +21,7 @@ export const proxyRoute = async (req: http.IncomingMessage, res: http.ServerResp
return;
}
if (pathname.startsWith('/client')) {
logger.info('url', { url: req.url });
console.debug('handle by router');
return;
}
@@ -74,7 +75,7 @@ export const proxyRoute = async (req: http.IncomingMessage, res: http.ServerResp
indexPath: localProxyProxy.indexPath,
});
}
const creatCenterProxy = createApiProxy(_assistantConfig?.pageApi || 'https://kevisual.cn', ['/root']);
const creatCenterProxy = createApiProxy(_assistantConfig?.pageApi || 'https://kevisual.cn', ['/root', '/' + _user]);
const centerProxy = creatCenterProxy.find((item) => pathname.startsWith(item.path));
if (centerProxy) {
return httpProxy(req, res, {