String respData = httpResponse.body(); 在这行代码中获取到了错误信息,我的系统中引入了2个小程序配置,其中加签加密解签解密的逻辑是通用的,另一个小程序的全部是正常的我想知道是不是因为我这个小程序的备案是出于管局审核中,因为是今天上午才通过审核,是不是因为没同步状态导致的。
"errcode" : 40235,
"errmsg" : "invalid encrypt rid: 699fdec1-1c547f6d-004689c6"
}
public Object getUserPhoneNumber(String code) {
// 访问地址
String url = "https://api.weixin.qq.com/wxa/business/getuserphonenumber";
// 进行 加密\加签\发送请求
HttpResponse httpResponse = sendGetUserPhoneNumber(code, url);
// 提取响应体中的信息
if (httpResponse == null) {
throw new ServiceException(HttpStatusConstants.ERROR, "请求发送失败,请稍后重试");
}
// 平台证书签名数据,使用base64编码
String wechatmpSignature = httpResponse.header("Wechatmp-Signature");
// 小程序id
String wechatmpAppid = httpResponse.header("Wechatmp-Appid");
// 签名时时间戳
String wechatmpTimeStamp = httpResponse.header("Wechatmp-TimeStamp");
// 平台证书编号
String wechatmpSerial = httpResponse.header("Wechatmp-Serial");
// 即将失效的平台证书编号,非证书内序列号,仅在证书更换周期内出现
String wechatmpSerialDeprecated = httpResponse.header("Wechatmp-Serial-Deprecated");
// 即将失效的平台证书签名数据,仅在证书更换周期内出现,使用base64编码
String wechatmpSignatureDeprecated = httpResponse.header("Wechatmp-Signature-Deprecated");
// 响应数据
String respData = httpResponse.body();
// 加密\加签\发送完成 -> 进行解密\解签\提取信息
JsonObject resp = new JsonObject();
// 开放平台证书编号
resp.addProperty("resp_sn", wechatmpSerial);
resp.addProperty("resp_sig", wechatmpSignature);
resp.addProperty("resp_appid", wxSP2Config.getAppId());
resp.addProperty("resp_ts", wechatmpTimeStamp);
resp.addProperty("resp_data", respData);
if (wechatmpSerialDeprecated == null) {
wechatmpSerialDeprecated = "";
}
if (wechatmpSignatureDeprecated == null) {
wechatmpSignatureDeprecated = "";
}
// 如果证书快过期了才会出现这两个
resp.addProperty("resp_deprecated_sn", wechatmpSerialDeprecated);
resp.addProperty("resp_deprecated_sig", wechatmpSignatureDeprecated);
// 校验签名
boolean check = wxSP2ApiDecryptUtils.check(resp, url);
if (!check) {
log.error("微信小程序-验证签名失败!验签失败!");
throw new ServiceException("请求失败,请稍后再试");
}
// 解密
Object apiResp = wxSP2ApiDecryptUtils.getApiResp(url, Long.parseLong(wechatmpTimeStamp), respData);
return apiResp;
}

已解决!重新生成了api相关秘钥就好了
反复对比过证书秘钥并无问题Response Headers:null=[HTTP/1.1 200 OK]LogicRet=[40235]Connection=[keep-alive]Content-Length=[76]RetKey=[11]Date=[Thu, 26 Feb 2026 06:36:50 GMT]Content-Type=[application/json; encoding=utf-8]Response Body:{"errcode":40235,"errmsg":"invalid encrypt rid: 699fea01-0bcebc9d-206c6c66"}请求参数:{"iv" : "DXkBvfx3y0xz1aty","data" : "c66Gabfi8RoqEECJUEwBX6rlPpcOPlx0P4jlFqW+ZqTi0csJA6qmIhPc0S+KuguEsX6etvmV3bBeb9loJaKRGd+nJLEHYDBt1e96LEAwVkBo6IDuytrDazrscG93Uho58f3I6bJIbviovm+lBarOJQkH1dreXugH/4J86sptexUxAfFyz2dVzRYsPuQZBq78GKYIRHvsb4iTRfve3UH4","authtag" : "vrPa6XkvPqnB+4dKUgMotA=="}"signature" : "gIpfM3N3r0vNGGYO1Tqf3v/Q8hxxYofnn7g9h+TizYDxSXQAO4P8DUhWu5CG/zGnK9LgdaDjLQ6kIenpDMkgUChSyIYmfqdJFiVSv8MX8mWRj3NKBb1lzOzFsgxbBp9mU6kh4kmUJcjakkaW5Tc34+E8pU7klLRpyNuMl2FM3YleAHyhxoVP5FFM5VVqg52kvAg/hzl3hRHArj8xe8iLpShcV2dAZ9zuUF67J7qkBKSP8EtVFRteRVBbQH4zTpC7Wkxzx0wdpnL0jT2xpvIW6NfZyYk8qIoThQZOVgQBucZIBHfYrLhqtVaRXGUy035KVASv08/ppaf98CFzAzFr9A=="