光环助手V3.2数据统计需求(登录,问答精选刷新)
This commit is contained in:
@ -109,7 +109,11 @@ public class LoginUtils {
|
||||
String string = responseBody.string();
|
||||
JSONObject content = new JSONObject(string);
|
||||
int code = content.getInt("code");
|
||||
outputErrorHint(context, code);
|
||||
if (code == 403202) {
|
||||
captchaErrorHint(context, content);
|
||||
} else {
|
||||
outputErrorHint(context, code);
|
||||
}
|
||||
} catch (Exception e1) {
|
||||
e1.printStackTrace();
|
||||
Utils.toast(context, "无法获取验证码,请检查你的网络状态");
|
||||
@ -180,6 +184,20 @@ public class LoginUtils {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void captchaErrorHint(Context context, JSONObject content) {
|
||||
try {
|
||||
JSONObject detail = content.getJSONObject("detail");
|
||||
if ("isv.BUSINESS_LIMIT_CONTROL".equals(detail.getString("sub_code"))) {
|
||||
Utils.toast(context, "获取验证码已超过次数,请稍后再试");
|
||||
} else {
|
||||
Utils.toast(context, detail.getString("sub_msg"));
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void outputErrorHint(Context context, int code) {
|
||||
switch (code) {
|
||||
case 40000:
|
||||
|
||||
Reference in New Issue
Block a user