fix: 调用完根据授权码获取用户信息后 解析返回报文错误修改

This commit is contained in:
xiang2lin 2024-09-25 15:26:41 +08:00
parent aa591dc1ff
commit 90386c59a5
1 changed files with 8 additions and 1 deletions

View File

@ -221,7 +221,14 @@ 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 = ""; 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();
JSONObject resJsonObject = JSONObject.parseObject(res); JSONObject resJsonObject = JSONObject.parseObject(res);
JSONObject attribute = resJsonObject.getJSONObject("attribute"); JSONObject attribute = resJsonObject.getJSONObject("attribute");
String attributeCode = attribute.getString("code"); String attributeCode = attribute.getString("code");