Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
P1-03: vite.config.ts proxy '/api' → '/api/' 加尾部斜杠, 防止前缀匹配 /api-keys 导致 SPA 路由崩溃 P1-01: kernel_init 增加 api_key 变更检测(token 刷新后自动重连), streamStore 增加 401 自动恢复(refresh token → kernel reconnect), KernelClient 新增 getConfig() 方法 P1-02: /api/v1/usage 总计改从 billing_usage_quotas 读取 (authoritative source,SSE 和 JSON 均写入), by_model/by_day 仍从 usage_records 读取
40 lines
997 B
TypeScript
40 lines
997 B
TypeScript
import { defineConfig } from 'vite'
|
|
import react from '@vitejs/plugin-react'
|
|
import tailwindcss from '@tailwindcss/vite'
|
|
import path from 'path'
|
|
|
|
export default defineConfig({
|
|
plugins: [tailwindcss(), react()],
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(__dirname, 'src'),
|
|
},
|
|
},
|
|
server: {
|
|
port: 5173,
|
|
proxy: {
|
|
// SSE relay 端点需要长超时(流式响应可持续数分钟)
|
|
'/api/v1/relay/chat/completions': {
|
|
target: 'http://localhost:8080',
|
|
changeOrigin: true,
|
|
timeout: 600_000,
|
|
proxyTimeout: 600_000,
|
|
},
|
|
'/api/': {
|
|
target: 'http://localhost:8080',
|
|
changeOrigin: true,
|
|
timeout: 30_000,
|
|
proxyTimeout: 30_000,
|
|
configure: (proxy) => {
|
|
proxy.on('proxyReq', (proxyReq) => {
|
|
proxyReq.setTimeout(30_000)
|
|
})
|
|
proxy.on('proxyRes', (proxyRes) => {
|
|
proxyRes.setTimeout(30_000)
|
|
})
|
|
},
|
|
},
|
|
},
|
|
},
|
|
})
|