Skip to content

Commit fa3ee6c

Browse files
committed
通过webui访问统计文件
1 parent b5ca929 commit fa3ee6c

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

dashboard/electron/main/protocol.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,16 @@ const MIME_TYPES: Record<string, string> = {
2828
'.webp': 'image/webp',
2929
}
3030

31+
function shouldProxyToBackend(pathname: string): boolean {
32+
return pathname.startsWith('/api/') || pathname === '/maibot_statistics.html'
33+
}
34+
3135
export function registerAppProtocol(): void {
3236
protocol.handle('app', async (request) => {
3337
const url = new URL(request.url)
3438
const pathname = url.pathname
3539

36-
if (pathname.startsWith('/api/')) {
40+
if (shouldProxyToBackend(pathname)) {
3741
const backend = getActiveBackend()
3842
const targetUrl = backend
3943
? `${backend.url.replace(/\/$/, '')}${pathname}${url.search}`

0 commit comments

Comments
 (0)