mirror of
https://github.com/Wei-Shaw/claude-relay-service.git
synced 2026-01-23 09:38:02 +00:00
Merge pull request #249 from iRubbish/feat/webhook-manual-disable-notification
feat: 增强 webhook 通知功能,支持手动禁用账号通知
This commit is contained in:
@@ -550,6 +550,26 @@ class ClaudeAccountService {
|
||||
|
||||
updatedData.updatedAt = new Date().toISOString()
|
||||
|
||||
// 检查是否手动禁用了账号,如果是则发送webhook通知
|
||||
if (updates.isActive === 'false' && accountData.isActive === 'true') {
|
||||
try {
|
||||
const webhookNotifier = require('../utils/webhookNotifier')
|
||||
await webhookNotifier.sendAccountAnomalyNotification({
|
||||
accountId,
|
||||
accountName: updatedData.name || 'Unknown Account',
|
||||
platform: 'claude-oauth',
|
||||
status: 'disabled',
|
||||
errorCode: 'CLAUDE_OAUTH_MANUALLY_DISABLED',
|
||||
reason: 'Account manually disabled by administrator'
|
||||
})
|
||||
} catch (webhookError) {
|
||||
logger.error(
|
||||
'Failed to send webhook notification for manual account disable:',
|
||||
webhookError
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
await redis.setClaudeAccount(accountId, updatedData)
|
||||
|
||||
logger.success(`📝 Updated Claude account: ${accountId}`)
|
||||
|
||||
Reference in New Issue
Block a user