fix: 修复API统计和OpenAI路由问题

This commit is contained in:
shaw
2025-09-03 10:54:11 +08:00
parent 941cfacea9
commit b158a90b72
2 changed files with 9 additions and 3 deletions

View File

@@ -562,8 +562,14 @@ router.post('/api/batch-stats', async (req, res) => {
name: stats.name, name: stats.name,
isActive: true, isActive: true,
usage: stats.usage, usage: stats.usage,
dailyUsage: stats.dailyStats, dailyUsage: {
monthlyUsage: stats.monthlyStats ...stats.dailyStats,
formattedCost: CostCalculator.formatCost(stats.dailyStats.cost || 0)
},
monthlyUsage: {
...stats.monthlyStats,
formattedCost: CostCalculator.formatCost(stats.monthlyStats.cost || 0)
}
}) })
} }
}) })

View File

@@ -153,7 +153,7 @@ router.post('/responses', authenticateApiKey, async (req, res) => {
headers['host'] = 'chatgpt.com' headers['host'] = 'chatgpt.com'
headers['accept'] = isStream ? 'text/event-stream' : 'application/json' headers['accept'] = isStream ? 'text/event-stream' : 'application/json'
headers['content-type'] = 'application/json' headers['content-type'] = 'application/json'
req.body['store'] = false req.body['store'] = true
// 创建代理 agent // 创建代理 agent
const proxyAgent = createProxyAgent(proxy) const proxyAgent = createProxyAgent(proxy)