From 32d405427fddc5ae4c97e364e36081850e22f037 Mon Sep 17 00:00:00 2001 From: Hs1r1us <29907973+Hs1r1us@users.noreply.github.com> Date: Tue, 7 Jul 2020 18:16:25 +0800 Subject: [PATCH] =?UTF-8?q?1.3.0#=20=E7=99=BB=E9=99=86=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=94=99=E8=AF=AF=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tgfc/build.gradle | 2 +- .../main/java/net/jejer/hipda/async/LoginHelper.java | 12 +++++++++++- tgfc/src/main/res/values/hipda.xml | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/tgfc/build.gradle b/tgfc/build.gradle index c21a5b95..6f5a5c40 100644 --- a/tgfc/build.gradle +++ b/tgfc/build.gradle @@ -9,7 +9,7 @@ android { minSdkVersion 14 targetSdkVersion 28 versionCode 27 - versionName "1.2.9" + versionName "1.3.0" } buildTypes { diff --git a/tgfc/src/main/java/net/jejer/hipda/async/LoginHelper.java b/tgfc/src/main/java/net/jejer/hipda/async/LoginHelper.java index e221c096..9aedebbd 100644 --- a/tgfc/src/main/java/net/jejer/hipda/async/LoginHelper.java +++ b/tgfc/src/main/java/net/jejer/hipda/async/LoginHelper.java @@ -21,6 +21,8 @@ import java.util.HashMap; import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import de.greenrobot.event.EventBus; @@ -143,7 +145,15 @@ private int doLogin(String formhash) { mErrorMsg = "您输入的验证码不正确,请返回修改。"; return Constants.STATUS_SECCODE_FAIL_ABORT; } else { - mErrorMsg = "登录失败,未知错误"; + String mPattern = "
.*?<\\/p>";
+ Pattern r = Pattern.compile(mPattern);
+ Matcher m = r.matcher(rspStr.substring(rspStr.indexOf("")));
+ if (m.find()) {
+ String matcherStr = m.group();
+ mErrorMsg = "登录失败:" + matcherStr.substring(3,matcherStr.length()-4);
+ }else {
+ mErrorMsg = "登录失败,未知错误";
+ }
return Constants.STATUS_FAIL_ABORT;
}
} catch (Exception e) {
diff --git a/tgfc/src/main/res/values/hipda.xml b/tgfc/src/main/res/values/hipda.xml
index 4df59cd2..505960f6 100644
--- a/tgfc/src/main/res/values/hipda.xml
+++ b/tgfc/src/main/res/values/hipda.xml
@@ -3,7 +3,7 @@