This commit is contained in:
van
2026-05-09 23:57:16 +08:00
parent a48570da44
commit 2acfdf9708
2 changed files with 8 additions and 3 deletions

View File

@@ -75,7 +75,12 @@ public class WeComApplicationTextPushService {
String fishAid = StrUtil.trimToEmpty(goofishAgentId);
if (StrUtil.isNotBlank(defAid) && rid.equals(defAid)) {
if (StrUtil.isBlank(corpSecret)) {
throw new IllegalStateException("未配置 qywx.app.secret与 agentId 对应)");
String hint = "";
if (StrUtil.isNotBlank(goofishSecret)) {
hint = "(已配置的是 goofishSecret对应 AgentId " + fishAid + ";当前回调/推送为 "
+ defAid + ",须在 wxSend 配置 qywx.app.secret 或环境变量 QYWX_APP_SECRET";
}
throw new IllegalStateException("未配置 qywx.app.secret与 agentId 对应)" + hint);
}
sendTextWithAgent(toUser, content, defAid, corpSecret);
return;

View File

@@ -82,8 +82,8 @@ qywx:
app:
corpId: "ww929e7d6493c6336e"
agentId: "1000012"
# 与 agentId 对应的应用 Secret企微后台应用管理),用于 access_token + message/send
secret: ""
# 与 agentId 对应的应用 Secret企微后台应用管理 → Secret用于 gettoken + message/send
secret: "ou35xJbpYvTAMMD0fcbTw9wsfVArETj0cR5plEfD-Ns"
# 闲鱼订单通知自建应用POST /wx/send/goofishcorpid 仍用上面 corpId
# 生产建议仅通过环境变量注入,勿将真实 Secret 提交仓库
goofishAgentId: "1000013"