浏览代码

404优化与二级页面

chao 4 年之前
父节点
当前提交
f2313fc5be

+ 4 - 0
src/main/java/com/caimei/www/controller/RedirectController.java

@@ -36,6 +36,10 @@ public class RedirectController {
 	 */
 	@GetMapping("/cmpage/info-1-{id}.html")
 	public String toTopic(@PathVariable("id") Integer type) {
+		// 二手商品【旧】
+		if (Integer.valueOf(189).equals(type)){
+			return "redirect:/flea-market/list.html";
+		}
 		return "redirect:/topic.html?type=" + type;
 	}
 	/**

+ 4 - 8
src/main/resources/templates/error/404.html

@@ -5,13 +5,14 @@
     <title>采美365网--医疗美容生活美容正品采购平台</title>
     <template th:replace="components/head-link"></template>
     <style>
+        body {
+            background: #f6f6f6;
+            position: relative;
+        }
         /** PC端 */
         @media screen and (min-width:768px){
             body {
-                background: #f6f6f6;
                 min-width: 1184px;
-                position: relative;
-                text-align: center;
             }
             #errorContent{
                 margin-top: 30px;
@@ -24,11 +25,6 @@
         }
         /** 移动端 */
         @media screen and (max-width:768px){
-            body {
-                background: #f6f6f6;
-                position: relative;
-                text-align: center;
-            }
             #errorContent{
                 width: 100%!important;
                 min-height:250vw!important;

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

@@ -15,5 +15,18 @@
 </head>
 <body>
     <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">
+        window.onload=function(){
+            var arr = document.getElementsByTagName("a");
+            for (var i=0; i<arr.length; i++){
+                if(arr[i]){
+                    arr[i].setAttribute("target","_blank");
+                }
+                if(arr[i].className=='desc_link'){
+                   arr[i].setAttribute("target","");
+                }
+            }
+        }
+    </script>
 </body>
 </html>