WeChat Web QR Code Integration (#1961)

This commit is contained in:
hsguo
2026-03-24 18:37:41 +08:00
committed by GitHub
parent fcc20ec72c
commit fa5ab72022
10 changed files with 661 additions and 11 deletions
+18
View File
@@ -62,4 +62,22 @@ export async function patchAppConfig(
})
}
// WeChat QR login flow API
export interface WeixinFlowResponse {
flow_id: string
status: "wait" | "scaned" | "confirmed" | "expired" | "error"
qr_data_uri?: string
account_id?: string
error?: string
}
export async function startWeixinFlow(): Promise<WeixinFlowResponse> {
return request<WeixinFlowResponse>("/api/weixin/flows", { method: "POST" })
}
export async function pollWeixinFlow(flowID: string): Promise<WeixinFlowResponse> {
return request<WeixinFlowResponse>(`/api/weixin/flows/${encodeURIComponent(flowID)}`)
}
export type { ChannelsCatalogResponse, ConfigActionResponse }