mirror of
https://github.com/Wei-Shaw/claude-relay-service.git
synced 2026-01-23 09:38:02 +00:00
fix: 1.修复ClaudeConsole账号设置为专属绑定的功能
2. 修复Claude 官方账号会话窗口计算错误的问题
This commit is contained in:
@@ -340,6 +340,7 @@ router.post('/api-keys', authenticateAdmin, async (req, res) => {
|
||||
tokenLimit,
|
||||
expiresAt,
|
||||
claudeAccountId,
|
||||
claudeConsoleAccountId,
|
||||
geminiAccountId,
|
||||
permissions,
|
||||
concurrencyLimit,
|
||||
@@ -416,6 +417,7 @@ router.post('/api-keys', authenticateAdmin, async (req, res) => {
|
||||
tokenLimit,
|
||||
expiresAt,
|
||||
claudeAccountId,
|
||||
claudeConsoleAccountId,
|
||||
geminiAccountId,
|
||||
permissions,
|
||||
concurrencyLimit,
|
||||
@@ -441,7 +443,7 @@ router.post('/api-keys', authenticateAdmin, async (req, res) => {
|
||||
router.put('/api-keys/:keyId', authenticateAdmin, async (req, res) => {
|
||||
try {
|
||||
const { keyId } = req.params;
|
||||
const { tokenLimit, concurrencyLimit, rateLimitWindow, rateLimitRequests, claudeAccountId, geminiAccountId, permissions, enableModelRestriction, restrictedModels, enableClientRestriction, allowedClients, expiresAt, dailyCostLimit, tags } = req.body;
|
||||
const { tokenLimit, concurrencyLimit, rateLimitWindow, rateLimitRequests, claudeAccountId, claudeConsoleAccountId, geminiAccountId, permissions, enableModelRestriction, restrictedModels, enableClientRestriction, allowedClients, expiresAt, dailyCostLimit, tags } = req.body;
|
||||
|
||||
// 只允许更新指定字段
|
||||
const updates = {};
|
||||
@@ -478,6 +480,11 @@ router.put('/api-keys/:keyId', authenticateAdmin, async (req, res) => {
|
||||
// 空字符串表示解绑,null或空字符串都设置为空字符串
|
||||
updates.claudeAccountId = claudeAccountId || '';
|
||||
}
|
||||
|
||||
if (claudeConsoleAccountId !== undefined) {
|
||||
// 空字符串表示解绑,null或空字符串都设置为空字符串
|
||||
updates.claudeConsoleAccountId = claudeConsoleAccountId || '';
|
||||
}
|
||||
|
||||
if (geminiAccountId !== undefined) {
|
||||
// 空字符串表示解绑,null或空字符串都设置为空字符串
|
||||
|
||||
Reference in New Issue
Block a user