From aa591dc1ff252a99a69085de799aeee620c71d04 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Wed, 25 Sep 2024 15:19:16 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=B0=83=E7=94=A8=E5=AE=8C=E6=A0=B9?= =?UTF-8?q?=E6=8D=AE=E6=8E=88=E6=9D=83=E7=A0=81=E8=8E=B7=E5=8F=96=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E4=BF=A1=E6=81=AF=E5=90=8E=20=E8=A7=A3=E6=9E=90?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E6=8A=A5=E6=96=87=E9=94=99=E8=AF=AF=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sysnew/login/impl/LoginServiceImpl.java | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/login/impl/LoginServiceImpl.java b/base-service/src/main/java/com/hzya/frame/sysnew/login/impl/LoginServiceImpl.java index 95ff3251..c0ba52e8 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/login/impl/LoginServiceImpl.java +++ b/base-service/src/main/java/com/hzya/frame/sysnew/login/impl/LoginServiceImpl.java @@ -221,22 +221,15 @@ public class LoginServiceImpl implements ILoginService { params.put("corpid",entity.getString("corpid")); params.put("corpsecret",entity.getString("corpsecret")); params.put("access_token",entity.getString("access_token")); - String res = HttpRequest.post(url). - header("appId",appId). - header("apiCode",userApiCode). - header("publicKey","ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj"). - header("secretKey","fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA="). - body(params.toJSONString()). - execute(). - body(); + String res = ""; JSONObject resJsonObject = JSONObject.parseObject(res); JSONObject attribute = resJsonObject.getJSONObject("attribute"); - String errcode = attribute.getString("errcode"); - String errmsg = attribute.getString("errmsg"); - if(!"0".equals(errcode)){ - return BaseResult.getFailureMessageEntity("请求错误:"+errmsg); + String attributeCode = attribute.getString("code"); + String attributeMsg = attribute.getString("msg"); + if(!"200".equals(attributeCode)){ + return BaseResult.getFailureMessageEntity("请求错误:"+attributeMsg); } - String weComUserid = attribute.getString("userid"); + String weComUserid = attribute.getString("data"); userEntity.setWxUserId(weComUserid); userEntity = sysUserDao.queryOne(userEntity); if(null == userEntity ){