/** * @Title: handleAuthResp @Description:TODO * * @param resp void */ private int handleAuthResp(JSONObject resp) { try { int authCode = Integer.valueOf(ZXSSOJsonHelper.safeGet(resp, "auth-code")); if (authCode != 200) { return ZXSSOAuthStatus.getStatusFrmSrvCode(authCode); } String authResp = ZXSSOJsonHelper.safeGet(resp, "auth-resp"); if (authResp == null) { return ZXSSOAuthStatus.CAN_NOT_CONNECT_SERVER; } JSONObject user = new JSONObject(authResp); String token = ZXSSOJsonHelper.safeGet(user, "token"); ZXSSOAuthImpl.getInstance(null).saveUser(token, authResp); } catch (Exception e) { Log.e(TAG, "handleAuthResp fail e:" + e); return ZXSSOAuthStatus.CAN_NOT_CONNECT_SERVER; } return ZXSSOAuthStatus.SUCCESS; }
/** * @Title: handleDmpResult @Description:TODO * * @param resp * @throws JSONException void */ private int handleDmpResult(JSONObject dmp) { try { String retcode = ZXSSOJsonHelper.safeGet(dmp, "ret_code"); if ("2001".equals(retcode)) { return ZXSSOAuthStatus.SUCCESS; } else if ("2002".equals(retcode)) { return ZXSSOAuthStatus.REG_USERINFO_EXIST; } else if ("2003".equals(retcode)) { return ZXSSOAuthStatus.VIP_REG_FAIL; } } catch (Exception e) { Log.e(TAG, "handleDmpResult fail e:" + e); } return ZXSSOAuthStatus.VIP_REG_FAIL; }