fix(send-routing): address final code review findings

- WeComBotSender.resolveWebhookUrl: use custom URL as-is when no %s placeholder
- WeComBotSender: treat unparseable/blank response body as failure
- ConversationService.isAccountCompatibleWithConversation: ignore scene for single chats
- SendService.selectSendAccountCandidates: apply accountTypes filter for non-conversation records
- SendService: replace account type magic numbers with AccountType constants
- WeComChannelAdapter: use AccountType.WECOM_BOT.getCode() instead of literal 6
- admin-web Conversation.vue: fallback to channelType filter when scene is unset
- add tests for single-chat null scene, webhook_url propagation, and custom URL without %s
This commit is contained in:
2026-07-15 11:53:51 +08:00
parent c24891a82e
commit 0a326e7ff9
8 changed files with 165 additions and 25 deletions

View File

@@ -380,12 +380,18 @@ function formatAccountName(id: number | undefined) {
const filteredBindAccounts = computed(() => {
const scene = currentBindConversation.value?.conversationScene
const channelType = currentBindConversation.value?.channelType
if (scene === 1) {
return accounts.value.filter((a: any) => a.accountType === 6)
}
if (scene === 2) {
return accounts.value.filter((a: any) => a.accountType === 3)
}
if (channelType) {
return accounts.value.filter((a: any) =>
a.channelType?.toLowerCase() === channelType?.toLowerCase()
)
}
return accounts.value
})