This commit is contained in:
lvleigang 2024-09-25 15:20:34 +08:00
commit f5500c7014
1 changed files with 6 additions and 13 deletions

View File

@ -221,22 +221,15 @@ public class LoginServiceImpl implements ILoginService {
params.put("corpid",entity.getString("corpid")); params.put("corpid",entity.getString("corpid"));
params.put("corpsecret",entity.getString("corpsecret")); params.put("corpsecret",entity.getString("corpsecret"));
params.put("access_token",entity.getString("access_token")); params.put("access_token",entity.getString("access_token"));
String res = HttpRequest.post(url). String res = "";
header("appId",appId).
header("apiCode",userApiCode).
header("publicKey","ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj").
header("secretKey","fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=").
body(params.toJSONString()).
execute().
body();
JSONObject resJsonObject = JSONObject.parseObject(res); JSONObject resJsonObject = JSONObject.parseObject(res);
JSONObject attribute = resJsonObject.getJSONObject("attribute"); JSONObject attribute = resJsonObject.getJSONObject("attribute");
String errcode = attribute.getString("errcode"); String attributeCode = attribute.getString("code");
String errmsg = attribute.getString("errmsg"); String attributeMsg = attribute.getString("msg");
if(!"0".equals(errcode)){ if(!"200".equals(attributeCode)){
return BaseResult.getFailureMessageEntity("请求错误:"+errmsg); return BaseResult.getFailureMessageEntity("请求错误:"+attributeMsg);
} }
String weComUserid = attribute.getString("userid"); String weComUserid = attribute.getString("data");
userEntity.setWxUserId(weComUserid); userEntity.setWxUserId(weComUserid);
userEntity = sysUserDao.queryOne(userEntity); userEntity = sysUserDao.queryOne(userEntity);
if(null == userEntity ){ if(null == userEntity ){