From 6b85249f8126311557be06fb697249b817ec8805 Mon Sep 17 00:00:00 2001 From: 670848654 <670848654@qq.com> Date: Wed, 2 Sep 2020 21:37:37 +0800 Subject: [PATCH] update --- .../main/java/my/project/sakuraproject/main/home/HomeModel.java | 2 +- .../java/my/project/sakuraproject/main/search/SearchModel.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/my/project/sakuraproject/main/home/HomeModel.java b/app/src/main/java/my/project/sakuraproject/main/home/HomeModel.java index 525a973..b6e3905 100644 --- a/app/src/main/java/my/project/sakuraproject/main/home/HomeModel.java +++ b/app/src/main/java/my/project/sakuraproject/main/home/HomeModel.java @@ -43,7 +43,7 @@ public void onResponse(Call call, Response response) { JSONObject weekObj = new JSONObject(); Document body = Jsoup.parse(response.body().string()); if (body.html().contains("You have verified successfully")) { - Sakura.REDIRECTED = body.select("a").attr("href"); + Sakura.REDIRECTED = body.select("a").attr("href").replaceAll("/",""); getHtml(callback); return; } else { diff --git a/app/src/main/java/my/project/sakuraproject/main/search/SearchModel.java b/app/src/main/java/my/project/sakuraproject/main/search/SearchModel.java index 3345998..b7f081c 100644 --- a/app/src/main/java/my/project/sakuraproject/main/search/SearchModel.java +++ b/app/src/main/java/my/project/sakuraproject/main/search/SearchModel.java @@ -24,7 +24,7 @@ public class SearchModel extends BaseModel implements SearchContract.Model { @Override public void getData(String url, int page, boolean isMain, SearchContract.LoadDataCallback callback) { if (page != 1) - url = url.contains(Sakura.DOMAIN) ? url + "/?page=" + page: Sakura.DOMAIN + url + "/?page=" + page + Sakura.REDIRECTED.replace("/?", "&"); + url = url.contains(Sakura.DOMAIN) ? url + "/?page=" + page: Sakura.DOMAIN + url + "/?page=" + page + Sakura.REDIRECTED.replace("?", "&"); else url = url.contains(Sakura.DOMAIN) ? url + Sakura.REDIRECTED : Sakura.DOMAIN + url + Sakura.REDIRECTED; getHtml(url, isMain, callback);