presp = presp.trim().intern();
if (presp.startsWith("callback(") && presp.endsWith(");")) {
presp = presp.substring(presp.indexOf("{"), presp.indexOf("}") + 1);
Map<String, String> map = (Map<String, String>) Json.fromJson(presp);
if (map.get("openid") != null) {
Profile p = new Profile();
p.setValidatedId(map.get("openid")); // QQ定义的
p.setProviderId(getProviderId());
userProfile = p;
try {
Map<String, String> params = new HashMap<String, String>();
params.put("format", "json");
params.put("openid", map.get("openid"));
params.put("oauth_consumer_key", config.get_consumerKey());
response = authenticationStrategy.executeFeed("https://graph.qq.com/user/get_user_info", "GET", params, null, null);
presp = response.getResponseBodyAsString(Constants.ENCODING);
Map<String, Object> user_info = (Map<String, Object>) Json.fromJson(presp);
if ((Integer)user_info.get("ret") == 0 ) { //获取成功
if (user_info.get("nickname") != null)
p.setDisplayName(user_info.get("nickname").toString());
if (user_info.get("figureurl") != null)
p.setProfileImageURL(user_info.get("figureurl").toString());
if (user_info.get("gender") != null)
p.setGender(user_info.get("gender").toString());
}
//TODO 尝试获取Email等详细信息
} catch (Throwable e) {