From 37bef6e1ceacb0b36e56bd4c85c188f9cafc4232 Mon Sep 17 00:00:00 2001 From: xxy <1179705413@qq.com> Date: Tue, 31 Dec 2019 20:14:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=BD=91=E9=A1=B5=E6=A0=87?= =?UTF-8?q?=E9=A2=98=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../zinglizingli/books/web/BookController.java | 18 +++++++++--------- .../templates/books/book_content.html | 10 +++++----- .../resources/templates/books/book_detail.html | 8 ++++---- .../resources/templates/books/book_index.html | 10 +++++----- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/novel-front/src/main/java/xyz/zinglizingli/books/web/BookController.java b/novel-front/src/main/java/xyz/zinglizingli/books/web/BookController.java index bd88d61..7c0af91 100644 --- a/novel-front/src/main/java/xyz/zinglizingli/books/web/BookController.java +++ b/novel-front/src/main/java/xyz/zinglizingli/books/web/BookController.java @@ -220,9 +220,9 @@ public class BookController { } SeoConfig seoConfig = (SeoConfig) req.getServletContext().getAttribute(Constants.SEO_CONFIG_KEY); Map page = seoConfig.getPage(); - page.put("detail.title",page.get("detail.title").replaceAll("",book.getBookName())); - page.put("detail.keyword",page.get("detail.keyword").replaceAll("",book.getBookName())); - page.put("detail.description",page.get("detail.description").replaceAll("",book.getBookName())); + modelMap.put("title",page.get("detail.title").replaceAll("",book.getBookName())); + modelMap.put("keyword",page.get("detail.keyword").replaceAll("",book.getBookName())); + modelMap.put("description",page.get("detail.description").replaceAll("",book.getBookName())); return "books/book_detail"; } @@ -239,9 +239,9 @@ public class BookController { modelMap.put("bookId", bookId); SeoConfig seoConfig = (SeoConfig) req.getServletContext().getAttribute(Constants.SEO_CONFIG_KEY); Map page = seoConfig.getPage(); - page.put("catalog.title",page.get("catalog.title").replaceAll("",bookName)); - page.put("catalog.keyword",page.get("catalog.keyword").replaceAll("",bookName)); - page.put("catalog.description",page.get("catalog.description").replaceAll("",bookName)); + modelMap.put("title",page.get("catalog.title").replaceAll("",bookName)); + modelMap.put("keyword",page.get("catalog.keyword").replaceAll("",bookName)); + modelMap.put("description",page.get("catalog.description").replaceAll("",bookName)); return "books/book_index"; } @@ -279,9 +279,9 @@ public class BookController { modelMap.put("catId", catId); SeoConfig seoConfig = (SeoConfig) req.getServletContext().getAttribute(Constants.SEO_CONFIG_KEY); Map page = seoConfig.getPage(); - page.put("content.title",page.get("content.title").replaceAll("",bookName).replaceAll("",indexName)); - page.put("content.keyword",page.get("content.keyword").replaceAll("",bookName).replaceAll("",indexName)); - page.put("content.description",page.get("content.description").replaceAll("",bookName).replaceAll("",indexName)); + modelMap.put("title",page.get("content.title").replaceAll("",bookName).replaceAll("",indexName)); + modelMap.put("keyword",page.get("content.keyword").replaceAll("",bookName).replaceAll("",indexName)); + modelMap.put("description",page.get("content.description").replaceAll("",bookName).replaceAll("",indexName)); return "books/book_content"; } diff --git a/novel-front/src/main/resources/templates/books/book_content.html b/novel-front/src/main/resources/templates/books/book_content.html index cdad521..3640696 100644 --- a/novel-front/src/main/resources/templates/books/book_content.html +++ b/novel-front/src/main/resources/templates/books/book_content.html @@ -4,16 +4,16 @@ - + - + + th:content="${description}"> - - + +
diff --git a/novel-front/src/main/resources/templates/books/book_detail.html b/novel-front/src/main/resources/templates/books/book_detail.html index 5235db3..ec57347 100644 --- a/novel-front/src/main/resources/templates/books/book_detail.html +++ b/novel-front/src/main/resources/templates/books/book_detail.html @@ -3,15 +3,15 @@ - + - + + th:content="${description}"> - + diff --git a/novel-front/src/main/resources/templates/books/book_index.html b/novel-front/src/main/resources/templates/books/book_index.html index 5f9f48e..d260e50 100644 --- a/novel-front/src/main/resources/templates/books/book_index.html +++ b/novel-front/src/main/resources/templates/books/book_index.html @@ -5,16 +5,16 @@ - + - + + th:content="${description}"> - - + +