Browse Source

Merge remote-tracking branch 'origin/developer' into developer

zhengjinyi 4 years ago
parent
commit
dadf1fb14a

+ 0 - 1
src/main/java/com/caimei/www/config/CustomExceptionHandler.java

@@ -2,7 +2,6 @@ package com.caimei.www.config;
 
 import org.springframework.web.bind.annotation.ControllerAdvice;
 import org.springframework.web.bind.annotation.ExceptionHandler;
-import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.ResponseBody;
 import reactor.core.publisher.Mono;
 

+ 22 - 12
src/main/java/com/caimei/www/controller/unlimited/HomeController.java

@@ -24,6 +24,10 @@ import java.util.List;
 public class HomeController extends BaseController {
 
 	private static final String HOME_PATH = "index";
+    /** 错误页面 */
+	private static final String ERROR_PATH = "error/404";
+	private static final String SEARCH_CHILDREN = "error/search_children";
+
 
     private HomeService homeService;
     @Autowired
@@ -39,11 +43,27 @@ public class HomeController extends BaseController {
     @GetMapping("/index.html")
     public String home(final Model model) {
         model.addAttribute("msg", "首页");
-        /*List<PageFloor> pageFloors = homeService.getHomePageFloor();*/
-       /* model.addAttribute("pageFloors", pageFloors);*/
         return HOME_PATH;
     }
 
+    /**
+     *  404
+     */
+    @GetMapping("/404.html")
+    public String errorPage(final Model model) {
+        model.addAttribute("msg", "404页面");
+        return ERROR_PATH;
+    }
+
+    /**
+     *  腾讯公益
+     */
+    @GetMapping("/search_children.html")
+    public String searchChildren(final Model model) {
+        model.addAttribute("msg", "腾讯公益");
+        return SEARCH_CHILDREN;
+    }
+
     /**
      * 首页轮播图列表
      * @return
@@ -74,16 +94,6 @@ public class HomeController extends BaseController {
         return homeService.getHomePageFloorData();
     }
 
-    /**
-     * 首页楼层专题数据
-     * @return
-     */
-    /*@GetMapping("/home/topic")
-    @ResponseBody
-    public JsonModel<Map<String, Object>> getHomeTopicData() {
-        return homeService.getHomeTopicData();
-    }*/
-
     /**
      * 首页左侧广告图
      * @return

+ 42 - 6
src/main/resources/templates/error/404.html

@@ -4,21 +4,57 @@
 <head>
     <title>采美365网--医疗美容生活美容正品采购平台</title>
     <template th:replace="components/head-link"></template>
-    <link th:href="@{/css/base/404.css(v=${version})}" rel="stylesheet" type="text/css">
+    <style>
+        /** PC端 */
+        @media screen and (min-width:768px){
+            body {
+                background: #f6f6f6;
+                min-width: 1184px;
+                position: relative;
+                text-align: center;
+            }
+            #errorContent{
+                margin-top: 30px;
+                width:1200px!important;
+                min-height:750px!important;
+                height:auto!important;
+                overflow: hidden;
+                border:none;
+            }
+        }
+        /** 移动端 */
+        @media screen and (max-width:768px){
+            body {
+                background: #f6f6f6;
+                position: relative;
+                text-align: center;
+            }
+            #errorContent{
+                width: 100%!important;
+                min-height:250vw!important;
+                height:auto!important;
+                overflow: hidden;
+                border: none;
+            }
+
+        }
+    </style>
 </head>
 <body>
 <!-- 引用头部 -->
 <template th:replace="components/header"></template>
 
 <!-- 404页面 -->
-<div id="errorPage">
-    <img src="/img/base/error.png" alt="404">
-    <h5><a href="/" class="desc_link">回主页</a><a href="javascript:history.go(-1);" class="desc_link">返回上一步</a></h5>
+<div>
+    <iframe id="errorContent" src="/search_children.html"></iframe>
 </div>
-
 <!-- 引入底部 -->
 <template th:replace="components/footer"></template>
 <template th:replace="components/foot-link"></template>
-<script type="text/javascript" src="//qzonestyle.gtimg.cn/qzone/hybrid/app/404/search_children.js" charset="utf-8" homePageUrl="/" homePageName="返回首页"></script>
+<script type="text/javascript">
+    if(!($('#spiServer').val() && $('#spiServer').val().length>0)){
+        window.location.href = '/404.html';
+    }
+</script>
 </body>
 </html>

+ 19 - 0
src/main/resources/templates/error/search_children.html

@@ -0,0 +1,19 @@
+<!doctype html>
+<html lang="zh-CN">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport"
+          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
+    <meta http-equiv="X-UA-Compatible" content="ie=edge">
+    <title>腾讯公益404</title>
+    <style>
+    .desc_link{color:#E15616;}
+    @media screen and (max-width:768px){
+        html,body{min-height:250vw!important;height:auto!important;}
+    }
+    </style>
+</head>
+<body>
+    <script type="text/javascript" src="//qzonestyle.gtimg.cn/qzone/hybrid/app/404/search_children.js" charset="utf-8" homePageUrl="/" homePageName="返回首页"></script>
+</body>
+</html>