This commit is contained in:
eric
2026-03-31 12:53:53 -05:00
parent 99816764b5
commit 836ca360cb

View File

@@ -355,7 +355,8 @@ async def _handle_wechat_request(request: Request, app_id: Optional[str], backgr
response_app_id = str(data.get("ChannelId", "") or data.get("appid", "")).strip() or APP_ID
else:
resp_plain = json.dumps({"answer_type": "text", "text_info": {"short_answer": answer_text}}, ensure_ascii=False)
response_app_id = None if app_id else APP_ID
# thirdapi 场景也要携带 app_id 参与加密,否则平台可能判定回包无效
response_app_id = (app_id or APP_ID).strip() if isinstance(app_id, str) else APP_ID
return aes_encrypt_base64(resp_plain, ENCODING_AES_KEY, response_app_id)