mirror of
https://github.com/sipeed/picoclaw.git
synced 2026-06-12 18:08:54 +00:00
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:
@@ -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 }
|
||||
|
||||
Reference in New Issue
Block a user