| | |
| | | JSONObject responseObj = JSONObject.parseObject(response); |
| | | |
| | | if (responseObj.containsKey("errcode") && !"0".equals(responseObj.getString("errcode"))) { |
| | | throw new IllegalArgumentException("微信验证失败,可能是code失效"); |
| | | throw new IllegalArgumentException("微信验证失败,可能是code失效" + responseObj); |
| | | } |
| | | |
| | | String openId = responseObj.getString("openid"); |
| | |
| | | try { |
| | | Map userMap = new HashMap(); |
| | | userMap.put(CommonConstant.LOGIN_USER_ID, userInfo.getString("userId")); |
| | | userMap.put(CommonConstant.LOGIN_USER_NAME, userInfo.getString("name")); |
| | | String token = AuthenticationFactory.createAndSaveToken(userMap); |
| | | JSONObject paramOut = new JSONObject(); |
| | | paramOut.put("result", 0); |