diff --git a/novel-front/src/main/java/xyz/zinglizingli/books/web/IndexController.java b/novel-front/src/main/java/xyz/zinglizingli/books/web/IndexController.java index ae65341..69e88b2 100644 --- a/novel-front/src/main/java/xyz/zinglizingli/books/web/IndexController.java +++ b/novel-front/src/main/java/xyz/zinglizingli/books/web/IndexController.java @@ -3,10 +3,12 @@ package xyz.zinglizingli.books.web; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; import xyz.zinglizingli.books.core.constant.CacheKeyConstans; import xyz.zinglizingli.books.po.Book; import xyz.zinglizingli.books.service.BookService; @@ -42,7 +44,7 @@ public class IndexController { @RequestMapping(value = {"/index.html","/","/books","/book","/book/index.html"}) - public String index(ModelMap modelMap){ + public String index(@RequestParam(value = "noLazy", defaultValue = "0") String noLazy,HttpServletRequest req,ModelMap modelMap){ List recBooks = (List) commonCacheUtil.getObject(CacheKeyConstans.REC_BOOK_LIST_KEY); if (!indexRecBooksConfig.isRead() || recBooks == null) { List> configMap = indexRecBooksConfig.getRecBooks(); @@ -69,7 +71,10 @@ public class IndexController { modelMap.put("recBooks", recBooks); modelMap.put("hotBooks", hotBooks); modelMap.put("newBooks", newBooks); - + ServletContext application = req.getServletContext(); + if(!"1".equals(application.getAttribute("noLazy"))) { + application.setAttribute("noLazy", noLazy); + } return "books/index_"+indexTemplate; } } diff --git a/novel-front/src/main/resources/templates/books/book_search.html b/novel-front/src/main/resources/templates/books/book_search.html index 8afc1db..c85afcd 100644 --- a/novel-front/src/main/resources/templates/books/book_search.html +++ b/novel-front/src/main/resources/templates/books/book_search.html @@ -114,9 +114,11 @@
-
- +
+ +
diff --git a/novel-front/src/main/resources/templates/books/index_v2.html b/novel-front/src/main/resources/templates/books/index_v2.html index a4b0dfa..a829248 100644 --- a/novel-front/src/main/resources/templates/books/index_v2.html +++ b/novel-front/src/main/resources/templates/books/index_v2.html @@ -162,8 +162,10 @@
-
- + +
@@ -184,8 +186,10 @@
-
- + +
diff --git a/novel-front/src/main/resources/templates/books/mh_book_search.html b/novel-front/src/main/resources/templates/books/mh_book_search.html index d5eb72a..1ecb8e5 100644 --- a/novel-front/src/main/resources/templates/books/mh_book_search.html +++ b/novel-front/src/main/resources/templates/books/mh_book_search.html @@ -124,8 +124,10 @@
-
- + +
diff --git a/novel-front/src/main/resources/templates/books/soft_book_search.html b/novel-front/src/main/resources/templates/books/soft_book_search.html index 81037a6..c90765b 100644 --- a/novel-front/src/main/resources/templates/books/soft_book_search.html +++ b/novel-front/src/main/resources/templates/books/soft_book_search.html @@ -84,7 +84,7 @@ -