Răsfoiți Sursa

新增公共事件aop

tsurumure 8 luni în urmă
părinte
comite
92b2306926
22 a modificat fișierele cu 438 adăugiri și 192 ștergeri
  1. 7 7
      src/main/java/com/backendsys/modules/cms/pageIndex/controller/PageIndexController.java
  2. 1 3
      src/main/java/com/backendsys/modules/cms/siteinfo/controller/SiteInfoController.java
  3. 1 1
      src/main/java/com/backendsys/modules/cms/siteinfo/service/SiteInfoService.java
  4. 2 2
      src/main/java/com/backendsys/modules/cms/siteinfo/service/impl/SiteInfoServiceImpl.java
  5. 12 0
      src/main/java/com/backendsys/modules/common/aspect/Pages.java
  6. 61 0
      src/main/java/com/backendsys/modules/common/aspect/PagesAspect.java
  7. 0 24
      src/main/resources/__templates/__layout/head.html
  8. 0 73
      src/main/resources/__templates/__layout/layout-footer.html
  9. 0 61
      src/main/resources/__templates/__layout/layout-header.html
  10. 0 8
      src/main/resources/__templates/__layout/layout-top.html
  11. 0 10
      src/main/resources/__templates/__layout/layout.html
  12. 16 0
      src/main/resources/__templates/layout/head.html
  13. 71 1
      src/main/resources/__templates/layout/layout-footer.html
  14. 59 1
      src/main/resources/__templates/layout/layout-header.html
  15. 6 1
      src/main/resources/__templates/layout/layout-top.html
  16. 3 0
      src/main/resources/application.yml
  17. 0 0
      src/main/resources/i18n/locale.properties
  18. 25 0
      src/main/resources/i18n/locale_en.properties
  19. 25 0
      src/main/resources/i18n/locale_zh.properties
  20. 17 0
      src/main/resources/templates/layout/head.html
  21. 72 0
      src/main/resources/templates/layout/layout-footer.html
  22. 60 0
      src/main/resources/templates/layout/layout-header.html

+ 7 - 7
src/main/java/com/backendsys/modules/cms/pageHome/controller/PageHomeController.java → src/main/java/com/backendsys/modules/cms/pageIndex/controller/PageIndexController.java

@@ -1,6 +1,7 @@
-package com.backendsys.modules.cms.pageHome.controller;
+package com.backendsys.modules.cms.pageIndex.controller;
 
 import com.backendsys.modules.cms.siteinfo.service.SiteInfoService;
+import com.backendsys.modules.common.aspect.Pages;
 import jakarta.servlet.http.HttpServletRequest;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
@@ -8,17 +9,16 @@ import org.springframework.ui.Model;
 import org.springframework.web.bind.annotation.GetMapping;
 
 @Controller
-public class PageHomeController {
-
-    @Autowired
-    private SiteInfoService siteInfoService;
+public class PageIndexController {
 
+    @Pages
     @GetMapping({"/"})
-    public String home(Model model, HttpServletRequest request) {
+    public String index(Model model, HttpServletRequest request) {
+
 //        // -- 初始化公共事件 ---------------------------------------------
 //        RequestUtil.initResponse(model, request, cmsSiteInfoService, cmsNavigationService);
 //        // -- Header ---------------------------------------------
-//        model.addAttribute("title","首页");
+        model.addAttribute("title","首页");
 //        // -------------------------------------------------------
 //        model.addAttribute("bannerList", cmsBannerService.queryBannerPublic());
 //

+ 1 - 3
src/main/java/com/backendsys/modules/cms/siteinfo/controller/SiteInfoController.java

@@ -26,9 +26,7 @@ public class SiteInfoController {
     @PreAuthorize("@ss.hasPermi('13')")
     @GetMapping("/api/v2/cms/site/getSiteInfo")
     public Result getSiteInfo() {
-        SiteInfo siteInfo = new SiteInfo();
-        siteInfo.setId(1L);
-        return Result.success().put("data", siteInfoService.selectSiteInfo(siteInfo));
+        return Result.success().put("data", siteInfoService.selectSiteInfo());
     }
 
 //

+ 1 - 1
src/main/java/com/backendsys/modules/cms/siteinfo/service/SiteInfoService.java

@@ -8,7 +8,7 @@ import java.util.Map;
 public interface SiteInfoService {
 
     // 获取站点信息
-    SiteInfo selectSiteInfo(SiteInfo siteInfo);
+    SiteInfo selectSiteInfo();
     // 更新站点信息
     Map<String, Object> updateSiteInfo(SiteInfo siteInfo);
 

+ 2 - 2
src/main/java/com/backendsys/modules/cms/siteinfo/service/impl/SiteInfoServiceImpl.java

@@ -18,8 +18,8 @@ public class SiteInfoServiceImpl implements SiteInfoService {
      * 获取站点信息
      */
     @Override
-    public SiteInfo selectSiteInfo(SiteInfo siteInfo) {
-        return siteInfoDao.selectById(siteInfo.getId());
+    public SiteInfo selectSiteInfo() {
+        return siteInfoDao.selectById(1L);
     }
 
     /**

+ 12 - 0
src/main/java/com/backendsys/modules/common/aspect/Pages.java

@@ -0,0 +1,12 @@
+package com.backendsys.modules.common.aspect;
+
+import java.lang.annotation.*;
+
+/**
+ * 视图自动添加:站点信息、导航栏目
+ */
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface Pages {
+}

+ 61 - 0
src/main/java/com/backendsys/modules/common/aspect/PagesAspect.java

@@ -0,0 +1,61 @@
+package com.backendsys.modules.common.aspect;
+
+import cn.hutool.core.date.DateUtil;
+import com.backendsys.modules.common.config.security.utils.HttpRequestUtil;
+import jakarta.servlet.http.HttpServletRequest;
+import org.aspectj.lang.reflect.MethodSignature;
+import org.springframework.ui.Model;
+import com.backendsys.modules.cms.siteinfo.entity.SiteInfo;
+import com.backendsys.modules.cms.siteinfo.service.SiteInfoService;
+import org.aspectj.lang.JoinPoint;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Before;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.web.method.HandlerMethod;
+
+import java.lang.reflect.Method;
+
+/**
+ * 视图自动添加:站点信息、导航栏目
+ */
+@Aspect
+@Component
+public class PagesAspect {
+
+	@Autowired
+	private HttpRequestUtil httpRequestUtil;
+
+	@Autowired
+	private SiteInfoService siteInfoService;
+
+	@Before("@annotation(org.springframework.web.bind.annotation.GetMapping) && @annotation(pages)")
+	public void beforeGet(JoinPoint joinPoint, Pages pages) {
+
+		HttpServletRequest request = httpRequestUtil.getRequest();
+
+//		// 获取注解上的参数
+//		MethodSignature signature = (MethodSignature) joinPoint.getSignature();
+//		Method method = signature.getMethod();
+//		Pages params = method.getAnnotation(Pages.class);
+
+		// 从 JoinPoint 获取控制器方法的参数
+		Object[] args = joinPoint.getArgs();
+		for (Object arg : args) {
+			if (arg instanceof Model) {
+				Model model = (Model) arg;
+
+				// [Get] 获取站点信息
+				model.addAttribute("siteInfo", siteInfoService.selectSiteInfo());
+
+				// 其他信息
+				model.addAttribute("timestamp", DateUtil.current());			// 当前时间戳
+				model.addAttribute("request_uri", request.getRequestURI());				// 当前访问路径
+				model.addAttribute("request_query_string", request.getQueryString());	// 当前访问路径参数
+
+				break;
+			}
+		}
+	}
+
+}

+ 0 - 24
src/main/resources/__templates/__layout/head.html

@@ -1,24 +0,0 @@
-<head th:fragment="header">
-  <meta charset="UTF-8" />
-  <meta http-equiv="pragma" content="no-cache" />
-  <meta http-equiv="expires" content="0" />
-  <meta http-equiv="cache-control" content="no-cache, no-store, must-revalidate" />
-  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
-  <title th:text="${title} + ' - ' + ${siteInfo.name}"></title>
-  <meta name="keywords" th:content="${siteInfo.meta_keyword}" />
-  <meta name="description" th:content="${siteInfo.meta_description}" />
-  <link rel="shortcut icon" th:href="@{'/images/favicon.ico'}" type="image/x-icon"/>
-  <link rel="stylesheet" th:href="@{'/css/reset.css'}">
-
-  <link rel="stylesheet" th:href="@{'/js/plugins/layui/css/layui.css'}">
-  <script th:src="@{'/js/plugins/layui/layui.js'}"></script>
-
-  <link rel="stylesheet" th:href="@{'/js/plugins/swiper/swiper.min.css'}">
-  <script th:src="@{'/js/plugins/swiper/swiper.min.js'}"></script>
-
-  <link rel="stylesheet" th:href="@{'/css/public.css?v=' + ${requestVO.timestamp}}">
-  <link rel="stylesheet" th:href="@{'/css/default.css?v=' + ${requestVO.timestamp}}">
-  <script th:src="@{'/js/plugins/jquery.min.js'}"></script>
-  <script th:src="@{'/js/plugins/jquery.cookie.min.js'}"></script>
-  <script th:src="@{'/js/default.js?v=' + ${requestVO.timestamp}}"></script>
-</head>

+ 0 - 73
src/main/resources/__templates/__layout/layout-footer.html

@@ -1,73 +0,0 @@
-<div th:fragment="layout-footer">
-
-  <div class="footer-menutabs">
-    <a href="/" class="footer-menutabs-item"
-       th:classappend="${(requestVO.uri == '/' ? 'active' : '')}">
-       <img src="/images/icon-watch.svg" />
-      <span th:text="#{footer.menu.home}"></span>
-    </a>
-    <a href="/article?category_id=1" class="footer-menutabs-item"
-       th:classappend="${(requestVO.uri + '?' + requestVO.queryString) == '/article?category_id=1' ? 'active' : ''}">
-      <img src="/images/icon-product.svg" />
-      <span th:text="#{footer.menu.product}"></span>
-    </a>
-    <a href="/article?category_id=42" class="footer-menutabs-item"
-       th:classappend="${(requestVO.uri + '?' + requestVO.queryString) == '/article?category_id=42' ? 'active' : ''}">
-      <img src="/images/icon-video.svg" />
-      <span th:text="#{footer.menu.video}"></span>
-    </a>
-    <a href="/article?category_id=43" class="footer-menutabs-item"
-       th:classappend="${(requestVO.uri + '?' + requestVO.queryString) == '/article?category_id=43' ? 'active' : ''}">
-      <img src="/images/icon-ce.svg" />
-      <span th:text="#{footer.menu.ce}"></span>
-    </a>
-
-    <!-- 微信联系 -->
-    <a href="javascript:;" class="footer-menutabs-item" id="menuWechat"
-       th:attr="data-text1=#{footer.menu.wechatinfo.text1}, data-text2=#{footer.menu.wechatinfo.text2}"
-      >
-      <img src="/images/icon-wechat.svg" />
-      <span th:text="#{footer.menu.wechat}"></span>
-    </a>
-    <script>
-      // [Click] 点击 微信联系
-      $('#menuWechat').on('click', function() {
-        var text1 = $(this).attr('data-text1')
-        var text2 = $(this).attr('data-text2')
-        layer.open({
-          title: false, shadeClose: true, closeBtn: false,
-          content: '<div class="menu-wechat-dialog-content">' +
-              '<img src="/images/qrcode-wechat.jpg"/><div>' + text1 + '<br/>' + text2 + ':cpnana8</div>' +
-              '</div>',
-          btn: []
-        })
-      })
-    </script>
-    <style>
-      .menu-wechat-dialog-content > img { display: block; width: 160px; height: 160px; margin: 10px auto; }
-      .menu-wechat-dialog-content > div { font-size: 14px; text-align: center; line-height: 18px; }
-    </style>
-
-  </div>
-
-
-  <div class="hjcl-layout-footer flex items-center justify-center">
-    <div class="wrapper">
-
-      <ul class="footer-nav flex items-center justify-center mb-2">
-        <li th:each="nav, iterStat : ${navigation}" class="mx-2">
-          <a th:href="${nav.link}" th:class="${'link underline-hover underline-offset-4 '}">
-            <span th:text="${nav.navigation_name}"></span>
-          </a>
-          <span class="ml-3" th:if="${iterStat.index != navigation.size - 1}">|</span>
-        </li>
-      </ul>
-
-      <div class="footer-copyright flex items-center justify-center">
-        <span class="mx-1" th:utext="${siteInfo.copyright}"></span>
-        <span class="mx-1" th:utext="${siteInfo.icp}"></span>
-      </div>
-
-    </div>
-  </div>
-</div>

+ 0 - 61
src/main/resources/__templates/__layout/layout-header.html

@@ -1,61 +0,0 @@
-<div th:fragment="layout-header" class="hjcl-layout-header">
-
-  <div class="wrapper">
-
-    <div class="nav-menu" id="navMenu"></div>
-    <div class="nav-right-bar">
-      <div th:replace="~{components/language::language}"></div>
-    </div>
-
-    <!-- 导航 -->
-    <ul class="nav" id="nav">
-
-      <li class="first-nav-item" th:text="#{sub.sider.title.nav}"></li>
-
-      <li th:each="nav, iterStat : ${navigation}"
-          th:class="${(iterStat.index + 1 == (navigation.size + 1) / 2) ? 'middle-l' : (iterStat.index == (navigation.size + 1) / 2) ? 'middle-r' : ''}">
-        <div class="flex justify-between">
-          <a th:href="${nav.link}"
-             th:class="${'link underline-hover underline-offset-4 ' + (requestVO.uri == nav.link ? 'active' : '') + (nav.is_blank == 1 ? 'underline' : '')}">
-            <span th:text="${nav.navigation_name}"></span>
-          </a>
-          <span th:if="${nav.children.size > 0}" class="nav-more" id="navMore">+</span>
-        </div>
-        <!-- 子级导航 -->
-        <div th:if="${nav.children.size > 0}" class="navSub">
-          <div th:each="navChild : ${nav.children}">
-            <a th:href="${navChild.link}" th:text="${navChild.navigation_name}"></a>
-          </div>
-        </div>
-
-      </li>
-    </ul>
-    <div class="nav-mask" id="navMask"></div>
-    <script>
-      // [Click] 点击显示左侧 (或顶部) 导航
-      $('#navMenu').on('click', function() {
-          $(this).toggleClass('active')
-          $('#nav, #navMask').toggleClass('active')
-      })
-      // [Click] 导航 遮罩层
-      $('#navMask').on('click', function() {
-          $('#nav, #navMask').toggleClass('active')
-      })
-      // [Click] 点击子级导航
-      $('#navMore').on('click', function() {
-          // 切换文本内容
-          $(this).text(function(index, currentText) {
-              return currentText === '+' ? '-' : '+'
-          })
-          // 显示/隐藏菜单
-          $(this).parent().next('.navSub').toggleClass('active');
-      })
-    </script>
-
-    <!-- Logo -->
-    <a href="/" class="header-logo-link">
-      <img class="header-logo" th:src="@{/images/logo.png}" />
-    </a>
-
-  </div>
-</div>

+ 0 - 8
src/main/resources/__templates/__layout/layout-top.html

@@ -1,8 +0,0 @@
-<div th:fragment="layout-top" class="hjcl-layout-top">
-  <div class="wrapper">
-    <div class="text-xs"><span th:text="#{top.welcome}"></span>:cpnana8 / anywayto</div>
-    <div class="text-xs">
-      <div th:replace="~{components/language::language}"></div>
-    </div>
-  </div>
-</div>

+ 0 - 10
src/main/resources/__templates/__layout/layout.html

@@ -1,10 +0,0 @@
-<!DOCTYPE html>
-<html lang="en" xmlns:th="http://www.thymeleaf.org">
-<head th:replace="~{layout/head::head}"></head>
-<body>
-<div th:replace="~{layout/layout-top::layout-top}"></div>
-<div th:replace="~{layout/layout-header::layout-header}"></div>
-<th:block th:replace="~{${layout}}" />
-<div th:replace="~{layout/layout-footer::layout-footer}"></div>
-</body>
-</html>

+ 16 - 0
src/main/resources/__templates/layout/head.html

@@ -4,5 +4,21 @@
   <meta http-equiv="expires" content="0" />
   <meta http-equiv="cache-control" content="no-cache, no-store, must-revalidate" />
   <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
+  <title th:text="${title} + ' - ' + ${siteInfo.name}"></title>
+  <meta name="keywords" th:content="${siteInfo.meta_keyword}" />
+  <meta name="description" th:content="${siteInfo.meta_description}" />
   <link rel="shortcut icon" th:href="@{'/images/favicon.ico'}" type="image/x-icon"/>
+  <link rel="stylesheet" th:href="@{'/css/reset.css'}">
+
+  <link rel="stylesheet" th:href="@{'/js/plugins/layui/css/layui.css'}">
+  <script th:src="@{'/js/plugins/layui/layui.js'}"></script>
+
+  <link rel="stylesheet" th:href="@{'/js/plugins/swiper/swiper.min.css'}">
+  <script th:src="@{'/js/plugins/swiper/swiper.min.js'}"></script>
+
+  <link rel="stylesheet" th:href="@{'/css/public.css?v=' + ${requestVO.timestamp}}">
+  <link rel="stylesheet" th:href="@{'/css/default.css?v=' + ${requestVO.timestamp}}">
+  <script th:src="@{'/js/plugins/jquery.min.js'}"></script>
+  <script th:src="@{'/js/plugins/jquery.cookie.min.js'}"></script>
+  <script th:src="@{'/js/default.js?v=' + ${requestVO.timestamp}}"></script>
 </head>

+ 71 - 1
src/main/resources/__templates/layout/layout-footer.html

@@ -1,3 +1,73 @@
 <div th:fragment="layout-footer">
-  footer
+
+  <div class="footer-menutabs">
+    <a href="/" class="footer-menutabs-item"
+       th:classappend="${(requestVO.uri == '/' ? 'active' : '')}">
+       <img src="/images/icon-watch.svg" />
+      <span th:text="#{footer.menu.home}"></span>
+    </a>
+    <a href="/article?category_id=1" class="footer-menutabs-item"
+       th:classappend="${(requestVO.uri + '?' + requestVO.queryString) == '/article?category_id=1' ? 'active' : ''}">
+      <img src="/images/icon-product.svg" />
+      <span th:text="#{footer.menu.product}"></span>
+    </a>
+    <a href="/article?category_id=42" class="footer-menutabs-item"
+       th:classappend="${(requestVO.uri + '?' + requestVO.queryString) == '/article?category_id=42' ? 'active' : ''}">
+      <img src="/images/icon-video.svg" />
+      <span th:text="#{footer.menu.video}"></span>
+    </a>
+    <a href="/article?category_id=43" class="footer-menutabs-item"
+       th:classappend="${(requestVO.uri + '?' + requestVO.queryString) == '/article?category_id=43' ? 'active' : ''}">
+      <img src="/images/icon-ce.svg" />
+      <span th:text="#{footer.menu.ce}"></span>
+    </a>
+
+    <!-- 微信联系 -->
+    <a href="javascript:;" class="footer-menutabs-item" id="menuWechat"
+       th:attr="data-text1=#{footer.menu.wechatinfo.text1}, data-text2=#{footer.menu.wechatinfo.text2}"
+      >
+      <img src="/images/icon-wechat.svg" />
+      <span th:text="#{footer.menu.wechat}"></span>
+    </a>
+    <script>
+      // [Click] 点击 微信联系
+      $('#menuWechat').on('click', function() {
+        var text1 = $(this).attr('data-text1')
+        var text2 = $(this).attr('data-text2')
+        layer.open({
+          title: false, shadeClose: true, closeBtn: false,
+          content: '<div class="menu-wechat-dialog-content">' +
+              '<img src="/images/qrcode-wechat.jpg"/><div>' + text1 + '<br/>' + text2 + ':cpnana8</div>' +
+              '</div>',
+          btn: []
+        })
+      })
+    </script>
+    <style>
+      .menu-wechat-dialog-content > img { display: block; width: 160px; height: 160px; margin: 10px auto; }
+      .menu-wechat-dialog-content > div { font-size: 14px; text-align: center; line-height: 18px; }
+    </style>
+
+  </div>
+
+
+  <div class="hjcl-layout-footer flex items-center justify-center">
+    <div class="wrapper">
+
+      <ul class="footer-nav flex items-center justify-center mb-2">
+        <li th:each="nav, iterStat : ${navigation}" class="mx-2">
+          <a th:href="${nav.link}" th:class="${'link underline-hover underline-offset-4 '}">
+            <span th:text="${nav.navigation_name}"></span>
+          </a>
+          <span class="ml-3" th:if="${iterStat.index != navigation.size - 1}">|</span>
+        </li>
+      </ul>
+
+      <div class="footer-copyright flex items-center justify-center">
+        <span class="mx-1" th:utext="${siteInfo.copyright}"></span>
+        <span class="mx-1" th:utext="${siteInfo.icp}"></span>
+      </div>
+
+    </div>
+  </div>
 </div>

+ 59 - 1
src/main/resources/__templates/layout/layout-header.html

@@ -1,3 +1,61 @@
 <div th:fragment="layout-header" class="hjcl-layout-header">
-  header
+
+  <div class="wrapper">
+
+    <div class="nav-menu" id="navMenu"></div>
+    <div class="nav-right-bar">
+      <div th:replace="~{components/language::language}"></div>
+    </div>
+
+    <!-- 导航 -->
+    <ul class="nav" id="nav">
+
+      <li class="first-nav-item" th:text="#{sub.sider.title.nav}"></li>
+
+      <li th:each="nav, iterStat : ${navigation}"
+          th:class="${(iterStat.index + 1 == (navigation.size + 1) / 2) ? 'middle-l' : (iterStat.index == (navigation.size + 1) / 2) ? 'middle-r' : ''}">
+        <div class="flex justify-between">
+          <a th:href="${nav.link}"
+             th:class="${'link underline-hover underline-offset-4 ' + (requestVO.uri == nav.link ? 'active' : '') + (nav.is_blank == 1 ? 'underline' : '')}">
+            <span th:text="${nav.navigation_name}"></span>
+          </a>
+          <span th:if="${nav.children.size > 0}" class="nav-more" id="navMore">+</span>
+        </div>
+        <!-- 子级导航 -->
+        <div th:if="${nav.children.size > 0}" class="navSub">
+          <div th:each="navChild : ${nav.children}">
+            <a th:href="${navChild.link}" th:text="${navChild.navigation_name}"></a>
+          </div>
+        </div>
+
+      </li>
+    </ul>
+    <div class="nav-mask" id="navMask"></div>
+    <script>
+      // [Click] 点击显示左侧 (或顶部) 导航
+      $('#navMenu').on('click', function() {
+          $(this).toggleClass('active')
+          $('#nav, #navMask').toggleClass('active')
+      })
+      // [Click] 导航 遮罩层
+      $('#navMask').on('click', function() {
+          $('#nav, #navMask').toggleClass('active')
+      })
+      // [Click] 点击子级导航
+      $('#navMore').on('click', function() {
+          // 切换文本内容
+          $(this).text(function(index, currentText) {
+              return currentText === '+' ? '-' : '+'
+          })
+          // 显示/隐藏菜单
+          $(this).parent().next('.navSub').toggleClass('active');
+      })
+    </script>
+
+    <!-- Logo -->
+    <a href="/" class="header-logo-link">
+      <img class="header-logo" th:src="@{/images/logo.png}" />
+    </a>
+
+  </div>
 </div>

+ 6 - 1
src/main/resources/__templates/layout/layout-top.html

@@ -1,3 +1,8 @@
 <div th:fragment="layout-top" class="hjcl-layout-top">
-  top
+  <div class="wrapper">
+    <div class="text-xs"><span th:text="#{top.welcome}"></span>:cpnana8 / anywayto</div>
+    <div class="text-xs">
+      <div th:replace="~{components/language::language}"></div>
+    </div>
+  </div>
 </div>

+ 3 - 0
src/main/resources/application.yml

@@ -25,6 +25,9 @@ spring:
 #          max-idle: 8       # 最大空闲连接,默认8
 #          min-idle: 0       # 最小空闲连接,默认0
 
+  messages:
+    basename: i18n/locale
+
   web:
     resources:
       static-locations: classpath:/static/

+ 0 - 0
src/main/resources/i18n/locale.properties


+ 25 - 0
src/main/resources/i18n/locale_en.properties

@@ -0,0 +1,25 @@
+more = More
+settop = Top
+viewdetail = Detail
+category = Category
+back = Back
+
+top.welcome = Welcome to consult, WeChat ID:
+
+index.section1.title = Newest
+index.section2.title = HOT REVIEWS
+
+sub.sider.title.nav = Navigation
+sub.sider.welcome = Welcome to consult,
+sub.sider.wechat = WeChat ID:
+
+footer.menu.home = Homepage
+footer.menu.product = Product
+footer.menu.video = Video
+footer.menu.ce = Appraisal
+footer.menu.wechat = Wechat
+
+footer.menu.wechatinfo.text1 = Long press the QR code to add WeChat for contact.
+footer.menu.wechatinfo.text2 = Wechat
+
+search.input.placeholder = Enter the keyword to explore the ideal watch in your heart...

+ 25 - 0
src/main/resources/i18n/locale_zh.properties

@@ -0,0 +1,25 @@
+more = 更多
+settop = 置顶
+viewdetail = 查看详情
+category = 分类
+back = 返回
+
+top.welcome = 欢迎咨询,微信号:
+
+index.section1.title = 最新评测
+index.section2.title = 热门评测
+
+sub.sider.title.nav = 导航
+sub.sider.welcome = 欢迎咨询,
+sub.sider.wechat = 微信号:
+
+footer.menu.home = 首页
+footer.menu.product = 产品
+footer.menu.video = 视频
+footer.menu.ce = 测评
+footer.menu.wechat = 微信
+
+footer.menu.wechatinfo.text1 = 长按二维码添加微信咨询
+footer.menu.wechatinfo.text2 = 微信号
+
+search.input.placeholder = 输入关键字,探索您心中的理想手表..

+ 17 - 0
src/main/resources/templates/layout/head.html

@@ -5,4 +5,21 @@
   <meta http-equiv="cache-control" content="no-cache, no-store, must-revalidate" />
   <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
   <link rel="shortcut icon" th:href="@{'/images/favicon.ico'}" type="image/x-icon"/>
+
+  <title th:text="${title} + ' - ' + ${siteInfo.name}"></title>
+  <meta name="keywords" th:content="${siteInfo.meta_keyword}" />
+  <meta name="description" th:content="${siteInfo.meta_description}" />
+
+  <link rel="stylesheet" th:href="@{'/css/reset.css'}">
+  <link rel="stylesheet" th:href="@{'/js/plugins/layui/css/layui.css'}">
+  <script th:src="@{'/js/plugins/layui/layui.js'}"></script>
+
+  <link rel="stylesheet" th:href="@{'/js/plugins/swiper/swiper.min.css'}">
+  <script th:src="@{'/js/plugins/swiper/swiper.min.js'}"></script>
+
+  <link rel="stylesheet" th:href="@{'/css/public.css?v=' + ${timestamp}}">
+  <link rel="stylesheet" th:href="@{'/css/default.css?v=' + ${timestamp}}">
+  <script th:src="@{'/js/plugins/jquery.min.js'}"></script>
+  <script th:src="@{'/js/plugins/jquery.cookie.min.js'}"></script>
+  <script th:src="@{'/js/default.js?v=' + ${timestamp}}"></script>
 </head>

+ 72 - 0
src/main/resources/templates/layout/layout-footer.html

@@ -1,3 +1,75 @@
 <div th:fragment="layout-footer">
+
   footer
+
+<!--  <div class="footer-menutabs">-->
+<!--    <a href="/" class="footer-menutabs-item"-->
+<!--       th:classappend="${(request_uri == '/' ? 'active' : '')}">-->
+<!--      <img src="/images/icon-watch.svg" />-->
+<!--      <span th:text="#{footer.menu.home}"></span>-->
+<!--    </a>-->
+<!--    <a href="/article?category_id=1" class="footer-menutabs-item"-->
+<!--       th:classappend="${(request_uri + '?' + request_query_string) == '/article?category_id=1' ? 'active' : ''}">-->
+<!--      <img src="/images/icon-product.svg" />-->
+<!--      <span th:text="#{footer.menu.product}"></span>-->
+<!--    </a>-->
+<!--    <a href="/article?category_id=42" class="footer-menutabs-item"-->
+<!--       th:classappend="${(request_uri + '?' + request_query_string) == '/article?category_id=42' ? 'active' : ''}">-->
+<!--      <img src="/images/icon-video.svg" />-->
+<!--      <span th:text="#{footer.menu.video}"></span>-->
+<!--    </a>-->
+<!--    <a href="/article?category_id=43" class="footer-menutabs-item"-->
+<!--       th:classappend="${(request_uri + '?' + request_query_string) == '/article?category_id=43' ? 'active' : ''}">-->
+<!--      <img src="/images/icon-ce.svg" />-->
+<!--      <span th:text="#{footer.menu.ce}"></span>-->
+<!--    </a>-->
+
+<!--    &lt;!&ndash; 微信联系 &ndash;&gt;-->
+<!--    <a href="javascript:;" class="footer-menutabs-item" id="menuWechat"-->
+<!--       th:attr="data-text1=#{footer.menu.wechatinfo.text1}, data-text2=#{footer.menu.wechatinfo.text2}"-->
+<!--    >-->
+<!--      <img src="/images/icon-wechat.svg" />-->
+<!--      <span th:text="#{footer.menu.wechat}"></span>-->
+<!--    </a>-->
+<!--    <script>-->
+<!--        // [Click] 点击 微信联系-->
+<!--        $('#menuWechat').on('click', function() {-->
+<!--            var text1 = $(this).attr('data-text1')-->
+<!--            var text2 = $(this).attr('data-text2')-->
+<!--            layer.open({-->
+<!--                title: false, shadeClose: true, closeBtn: false,-->
+<!--                content: '<div class="menu-wechat-dialog-content">' +-->
+<!--                    '<img src="/images/qrcode-wechat.jpg"/><div>' + text1 + '<br/>' + text2 + ':cpnana8</div>' +-->
+<!--                    '</div>',-->
+<!--                btn: []-->
+<!--            })-->
+<!--        })-->
+<!--    </script>-->
+<!--    <style>-->
+<!--        .menu-wechat-dialog-content > img { display: block; width: 160px; height: 160px; margin: 10px auto; }-->
+<!--        .menu-wechat-dialog-content > div { font-size: 14px; text-align: center; line-height: 18px; }-->
+<!--    </style>-->
+
+<!--  </div>-->
+
+
+<!--  <div class="hjcl-layout-footer flex items-center justify-center">-->
+<!--    <div class="wrapper">-->
+
+<!--      <ul class="footer-nav flex items-center justify-center mb-2">-->
+<!--        <li th:each="nav, iterStat : ${navigation}" class="mx-2">-->
+<!--          <a th:href="${nav.link}" th:class="${'link underline-hover underline-offset-4 '}">-->
+<!--            <span th:text="${nav.navigation_name}"></span>-->
+<!--          </a>-->
+<!--          <span class="ml-3" th:if="${iterStat.index != navigation.size - 1}">|</span>-->
+<!--        </li>-->
+<!--      </ul>-->
+
+<!--      <div class="footer-copyright flex items-center justify-center">-->
+<!--        <span class="mx-1" th:utext="${siteInfo.copyright}"></span>-->
+<!--        <span class="mx-1" th:utext="${siteInfo.icp}"></span>-->
+<!--      </div>-->
+
+<!--    </div>-->
+<!--  </div>-->
 </div>

+ 60 - 0
src/main/resources/templates/layout/layout-header.html

@@ -1,3 +1,63 @@
 <div th:fragment="layout-header" class="hjcl-layout-header">
+
   header
+
+<!--  <div class="wrapper">-->
+
+<!--    <div class="nav-menu" id="navMenu"></div>-->
+<!--    <div class="nav-right-bar">-->
+<!--      <div th:replace="~{components/language::language}"></div>-->
+<!--    </div>-->
+
+<!--    &lt;!&ndash; 导航 &ndash;&gt;-->
+<!--    <ul class="nav" id="nav">-->
+
+<!--      <li class="first-nav-item" th:text="#{sub.sider.title.nav}"></li>-->
+
+<!--      <li th:each="nav, iterStat : ${navigation}"-->
+<!--          th:class="${(iterStat.index + 1 == (navigation.size + 1) / 2) ? 'middle-l' : (iterStat.index == (navigation.size + 1) / 2) ? 'middle-r' : ''}">-->
+<!--        <div class="flex justify-between">-->
+<!--          <a th:href="${nav.link}"-->
+<!--             th:class="${'link underline-hover underline-offset-4 ' + (request_uri == nav.link ? 'active' : '') + (nav.is_blank == 1 ? 'underline' : '')}">-->
+<!--            <span th:text="${nav.navigation_name}"></span>-->
+<!--          </a>-->
+<!--          <span th:if="${nav.children.size > 0}" class="nav-more" id="navMore">+</span>-->
+<!--        </div>-->
+<!--        &lt;!&ndash; 子级导航 &ndash;&gt;-->
+<!--        <div th:if="${nav.children.size > 0}" class="navSub">-->
+<!--          <div th:each="navChild : ${nav.children}">-->
+<!--            <a th:href="${navChild.link}" th:text="${navChild.navigation_name}"></a>-->
+<!--          </div>-->
+<!--        </div>-->
+
+<!--      </li>-->
+<!--    </ul>-->
+<!--    <div class="nav-mask" id="navMask"></div>-->
+<!--    <script>-->
+<!--        // [Click] 点击显示左侧 (或顶部) 导航-->
+<!--        $('#navMenu').on('click', function() {-->
+<!--            $(this).toggleClass('active')-->
+<!--            $('#nav, #navMask').toggleClass('active')-->
+<!--        })-->
+<!--        // [Click] 导航 遮罩层-->
+<!--        $('#navMask').on('click', function() {-->
+<!--            $('#nav, #navMask').toggleClass('active')-->
+<!--        })-->
+<!--        // [Click] 点击子级导航-->
+<!--        $('#navMore').on('click', function() {-->
+<!--            // 切换文本内容-->
+<!--            $(this).text(function(index, currentText) {-->
+<!--                return currentText === '+' ? '-' : '+'-->
+<!--            })-->
+<!--            // 显示/隐藏菜单-->
+<!--            $(this).parent().next('.navSub').toggleClass('active');-->
+<!--        })-->
+<!--    </script>-->
+
+<!--    &lt;!&ndash; Logo &ndash;&gt;-->
+<!--    <a href="/" class="header-logo-link">-->
+<!--      <img class="header-logo" th:src="@{/images/logo.png}" />-->
+<!--    </a>-->
+
+<!--  </div>-->
 </div>