合并微信小程序和支付宝小程序登录入口

This commit is contained in:
谭凯凯
2024-09-24 15:30:07 +08:00
committed by Tankaikai
parent fbd0ab240c
commit eb2156857c

View File

@@ -113,7 +113,8 @@ public class LoginContoller {
JSONObject wxResp = WechatUtil.getSessionKeyOrOpenId(code, customAppId, customSecrete);
Integer errCode = wxResp.getInteger("errcode");
log.info("微信获取openid响应报文{}", wxResp.toJSONString());
if (errCode.intValue() != 0) {
boolean hasOpenId = wxResp.containsKey("openid");
if (!hasOpenId) {
return Result.fail("登录失败:" + wxResp.getString("errmsg"));
}
// 3.接收微信接口服务 获取返回的参数