| | |
| | | if (param == null) {
|
| | | return null;
|
| | | }
|
| | | return getWeiXinUser(param);
|
| | | WeiXinUser weiXinUser = getWeiXinUser(param);
|
| | | if (weiXinUser != null && StringUtil.isNullOrEmpty(weiXinUser.getUnionid())
|
| | | && !StringUtil.isNullOrEmpty(param.getUnionId())) {
|
| | | weiXinUser.setUnionid(param.getUnionId());
|
| | | }
|
| | | return weiXinUser;
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | if (result != null && !StringUtil.isNullOrEmpty(result.getUrl())) {
|
| | | user.setHeadimgurl(result.getUrl());
|
| | | // COS删除其余头像
|
| | | // String prefix = String.format("/portrait/wx/%s_", user.getUnionid());
|
| | | // ObjectListing list = COSManager.getInstance().getObjectList(prefix, null, 30);
|
| | | // if (list != null && list.getObjectSummaries() != null)
|
| | | // for (COSObjectSummary object : list.getObjectSummaries()) {
|
| | | // if (!result.getUrl().contains(object.getKey())) {
|
| | | // COSManager.getInstance().deleteFile(object.getKey());
|
| | | // }
|
| | | // }
|
| | | // String prefix = String.format("/portrait/wx/%s_",
|
| | | // user.getUnionid());
|
| | | // ObjectListing list =
|
| | | // COSManager.getInstance().getObjectList(prefix, null, 30);
|
| | | // if (list != null && list.getObjectSummaries() != null)
|
| | | // for (COSObjectSummary object : list.getObjectSummaries())
|
| | | // {
|
| | | // if (!result.getUrl().contains(object.getKey())) {
|
| | | // COSManager.getInstance().deleteFile(object.getKey());
|
| | | // }
|
| | | // }
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | String refreshToken = jsonObject.optString("refresh_token");
|
| | | String scope = jsonObject.optString("scope");
|
| | | int expires = jsonObject.optInt("expires_in");
|
| | | String unionId = jsonObject.optString("unionid");
|
| | |
|
| | | weiXinUserParam.setRefreshToken(refreshToken);
|
| | | weiXinUserParam.setOpenId(openId);
|
| | | weiXinUserParam.setExpires(expires);
|
| | | weiXinUserParam.setAccessToken(accessToken);
|
| | | weiXinUserParam.setScope(scope);
|
| | | weiXinUserParam.setUnionId(unionId);
|
| | |
|
| | | return weiXinUserParam;
|
| | | }
|