feat(web): add WeCom QR binding flow to channel settings (#1994)

- add backend WeCom QR flow endpoints and in-memory flow state management
- add frontend WeCom binding UI with QR polling and channel enable toggle
- update channel config behavior and i18n strings for WeCom and WeChat
- apply minor formatting cleanup in model-related components
This commit is contained in:
wenjie
2026-03-25 16:15:04 +08:00
committed by GitHub
parent 6bd8fec87a
commit eb307e942b
11 changed files with 945 additions and 16 deletions
+20
View File
@@ -72,6 +72,14 @@ export interface WeixinFlowResponse {
error?: string
}
export interface WecomFlowResponse {
flow_id: string
status: "wait" | "scaned" | "confirmed" | "expired" | "error"
qr_data_uri?: string
bot_id?: string
error?: string
}
export async function startWeixinFlow(): Promise<WeixinFlowResponse> {
return request<WeixinFlowResponse>("/api/weixin/flows", { method: "POST" })
}
@@ -84,4 +92,16 @@ export async function pollWeixinFlow(
)
}
export async function startWecomFlow(): Promise<WecomFlowResponse> {
return request<WecomFlowResponse>("/api/wecom/flows", { method: "POST" })
}
export async function pollWecomFlow(
flowID: string,
): Promise<WecomFlowResponse> {
return request<WecomFlowResponse>(
`/api/wecom/flows/${encodeURIComponent(flowID)}`,
)
}
export type { ChannelsCatalogResponse, ConfigActionResponse }