/** * 获取 用户 信息 * * @param url * @param cookieStore * @return */ public static XLLXUserInfo getUser(Context context, Header cookies) { String content = HttpUtils.getContent(USERINFO_URL, new Header[] {cookies}, null); if (content != null) { try { String json = content.substring(content.indexOf("{")); XLLXUserInfo info = new XLLXUserInfo(); JSONTokener jsonParser = new JSONTokener(json); JSONObject object = (JSONObject) jsonParser.nextValue(); info.autopay = Integer.parseInt(object.getString("autopay")); info.daily = Integer.parseInt(object.getString("daily")); info.expiredate = object.getString("expiredate"); info.growvalue = Integer.parseInt(object.getString("growvalue")); info.isvip = Integer.parseInt(object.getString("isvip")); info.isyear = Integer.parseInt(object.getString("isvip")); info.level = Integer.parseInt(object.getString("level")); info.nickname = object.getString("nickname"); info.usrname = object.getString("usrname"); info.payname = object.getString("payname"); saveUserInfo(context, info); return info; } catch (Exception e) { e.printStackTrace(); } } return null; }