From e60c4ef863251ec611c019a46cc5ff5b649642b9 Mon Sep 17 00:00:00 2001 From: panqihua <1029559041@qq.com> Date: Tue, 14 Apr 2020 13:23:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=BD=91=E7=BB=9C=E8=B0=83?= =?UTF-8?q?=E8=AF=95=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/community/pocket/util/HttpUtil.java | 9 +++++++-- app/src/main/res/values-en-rUS/strings.xml | 1 + app/src/main/res/values-zh-rCN/strings.xml | 1 + app/src/main/res/values/strings.xml | 1 + 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/community/pocket/util/HttpUtil.java b/app/src/main/java/com/community/pocket/util/HttpUtil.java index c64e837..d05cca0 100644 --- a/app/src/main/java/com/community/pocket/util/HttpUtil.java +++ b/app/src/main/java/com/community/pocket/util/HttpUtil.java @@ -66,8 +66,13 @@ public class HttpUtil { public void onFailure(@NotNull Call call, @NotNull IOException e) { if (BuildConfig.DEBUG) { Looper.prepare(); - new AlertDialog.Builder(context) - .setMessage(context.getString(R.string.check_server_fail, BuildConfig.API_HOST)).show(); + if (BuildConfig.API_HOST.contains("http")) { + new AlertDialog.Builder(context) + .setMessage(context.getString(R.string.check_server_fail, BuildConfig.API_HOST)).show(); + } else { + new AlertDialog.Builder(context) + .setMessage(context.getString(R.string.error_api_host, BuildConfig.API_HOST)).show(); + } Looper.loop(); } } diff --git a/app/src/main/res/values-en-rUS/strings.xml b/app/src/main/res/values-en-rUS/strings.xml index 301d648..1d2a57d 100644 --- a/app/src/main/res/values-en-rUS/strings.xml +++ b/app/src/main/res/values-en-rUS/strings.xml @@ -177,4 +177,5 @@ uncheck connect server ok connect server:%1s fail + api error%1s \ No newline at end of file diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index abbe476..08cef4a 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -177,4 +177,5 @@ 未审核 连接服务端成功 调试信息:无法连接到服务端:%1s + 非法服务端配置:%1s \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 4bb129e..6206619 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -178,6 +178,7 @@ uncheck connect server ok connect server:%1s fail + api error%1s