Explorar o código

seo优化url传参2

chao %!s(int64=4) %!d(string=hai) anos
pai
achega
defcc5296c

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

@@ -18,19 +18,19 @@ public class RedirectController {
      */
     @GetMapping("/supplier/prolist-{id}.html")
     public String toSupplier(@PathVariable("id") Integer supplierId) {
-        return "redirect:/supplier/"+ supplierId +".html";
+        return "redirect:/supplier-"+ supplierId +".html";
     }
     @GetMapping("/web/supplier/view/supplierHomePage.jsp")
     public String toSupplier2(Integer shopId) {
-        return "redirect:/supplier/"+ shopId +".html";
+        return "redirect:/supplier-"+ shopId +".html";
     }
     @GetMapping("/supplier/productlist-{id}.html")
     public String toSupplierProduct(@PathVariable("id") Integer supplierId) {
-        return "redirect:/supplier/"+ supplierId +".html";
+        return "redirect:/supplier-"+ supplierId +".html";
     }
     @GetMapping("/supplier/index.html")
     public String toSupplier3(@RequestParam("id") Integer supplierId) {
-        return "redirect:/supplier/"+ supplierId +".html";
+        return "redirect:/supplier-"+ supplierId +".html";
     }
 
     /**

+ 1 - 1
src/main/java/com/caimei/www/controller/unlimited/SupplierController.java

@@ -40,7 +40,7 @@ public class SupplierController extends BaseController {
     /**
      * 供应商首页
      */
-    @GetMapping("/supplier/{id}.html")
+    @GetMapping("/supplier-{id}.html")
     public String home(final Model model, @PathVariable("id") Integer supplierId) {
         SupplierDetail detail = supplierService.getSupplierById(supplierId);
         if(detail== null){

+ 3 - 3
src/main/resources/static/js/base.js

@@ -139,7 +139,7 @@ var globalHead = new Vue({
             });
         },
         pageLinkSupplier: function(){//预览商品
-            window.open('/supplier/'+this.shopId+'.html');
+            window.open('/supplier-'+this.shopId+'.html');
         },
         // 退出登录
         userLogOut: function(){
@@ -197,7 +197,7 @@ var globalHead = new Vue({
         }
         console.log('hello')
         _self.nav_linkName = decodeURI(CAIMEI.getUrlParam('name'));
-        if(!_self.nav_linkName) {
+        if(!_self.nav_linkName || _self.nav_linkName.length === 0 || _self.nav_linkName == "undefined") {
              var paramsArr = window.location.pathname.split(".")[0].split("-");
              if (paramsArr[0].indexOf('/product/type') >= 0) {
                  var pageId =  paramsArr.length>=1 ? paramsArr[1] : '';
@@ -208,7 +208,7 @@ var globalHead = new Vue({
                  }
              } else if (paramsArr[0].indexOf('/info/center') >= 0){
                 _self.nav_linkName = "信息平台";
-             } else if (paramsArr[0].indexOf('/flea-market') >= 0){
+             } else if (paramsArr[0].indexOf('/flea-market') >= 0 && (paramsArr.length>=1 && paramsArr[1].indexOf('market') >= 0)){
                 _self.nav_linkName = "二手市场";
              } else if (paramsArr[0].indexOf('/investment') >= 0){
                 _self.nav_linkName = "品牌招商";

+ 1 - 1
src/main/resources/static/js/document/list.js

@@ -61,7 +61,7 @@ var documentList = new Vue({
         },
         supplierDetails:function(id){//供应商主页
             if(id){
-                location.href = '/supplier/'+id+'.html';
+                location.href = '/supplier-'+id+'.html';
             }
         },
         keyupSearch: function(event) {

+ 1 - 1
src/main/resources/static/js/product/beautytopic.js

@@ -81,7 +81,7 @@ var beautytopic = new Vue({
             }
         },
         gosupplier:function (id) {
-            window.location.href='/supplier/'+id+'.html';
+            window.location.href='/supplier-'+id+'.html';
         },
         bigImag:function (img) {
             this.image = img;

+ 1 - 1
src/main/resources/static/js/supplier-center/shop/preview.js

@@ -37,7 +37,7 @@ var previewContainer = new Vue({
             this.tabIndex = index;
         },
         homePageFn: function(){
-            window.open('/supplier/'+this.shopId+'.html');
+            window.open('/supplier-'+this.shopId+'.html');
         },
         toFixedFn: function(text){
             return Number(text).toFixed(2);

+ 3 - 1
src/main/resources/static/js/supplier/index.js

@@ -153,7 +153,9 @@ var supplierHome = new Vue({
         }
     },
     created: function () {
-        this.params.id = getUrlParam("id") ? getUrlParam("id") * 1 : 0;
+        // this.params.id = getUrlParam("id") ? getUrlParam("id") * 1 : 0;
+        var paramsArr = window.location.pathname.split(".")[0].split("-");
+        this.params.id =  paramsArr.length>=1 ? paramsArr[1]*1 : 0;
         if(this.params.id !== 0) {
             this.getShopInfo();
             this.getBanners();

+ 3 - 3
src/main/resources/templates/product/detail.html

@@ -211,7 +211,7 @@
     </div>
     <div class="wrap clear">
         <div v-if="!isPC" class="mShopBox">
-            <a th:href="@{'/supplier/'+${product.shopId}+'.html'}">
+            <a th:href="@{'/supplier-'+${product.shopId}+'.html'}">
                 <span class="name"><em th:text="${product.shopTitle}"></em><i th:if="not${#strings.isEmpty(product.license)}" class="icon mIcon shop"></i></span>
                 <span>经营范围:<em th:text="${product.businessScope}"></em></span>
                 <span>所在地区:<em th:text="${product.shopAddress}"></em></span>
@@ -266,7 +266,7 @@
             <div class="shopBox">
                 <div class="hd">供应商信息</div>
                 <div class="bd">
-                    <a th:href="@{'/supplier/'+ ${product.shopId} +'.html'}">
+                    <a th:href="@{'/supplier-'+ ${product.shopId} +'.html'}">
                         <div class="name"><span th:text="${product.shopTitle}"></span><i th:if="not${#strings.isEmpty(product.license)}" class="icon shop"></i></div>
                     </a>
                     <template th:if="not${#strings.isEmpty(product.businessScope)}">
@@ -278,7 +278,7 @@
                         <div class="con" th:text="${product.shopAddress}"></div>
                     </template>
                     <div class="tit">满意度:<i th:each="i:${#numbers.sequence(1,5)}" class="icon heart"></i></div>
-                    <a th:href="@{'/supplier/'+ ${product.shopId} +'.html'}" class="btn">查看主页</a>
+                    <a th:href="@{'/supplier-'+ ${product.shopId} +'.html'}" class="btn">查看主页</a>
                 </div>
             </div>
             <div class="contact">

+ 1 - 1
src/main/resources/templates/shopping/cart.html

@@ -49,7 +49,7 @@
                     <div class="c0">
                         <input class="check" type="checkbox" @change="ckeckSupplier($event, supplier.checked)" v-model="supplier.checked">
                     </div>
-                    <a  :href="'/supplier/'+supplier.id+'.html'" target="_blank">
+                    <a  :href="'/supplier-'+supplier.id+'.html'" target="_blank">
                         <img class="img" :src="supplier.logo">
                         <span class="name" v-text="supplier.name"></span>
                     </a>

+ 2 - 2
src/main/resources/templates/supplier-center/components/tableft.html

@@ -12,7 +12,7 @@
     <div class="navList">
         <span class="tab">我的店铺</span>
         <div class="con" style="display:none">
-            <a :href="'/supplier/'+GLOBAL_SHOP_ID+'.html'">查看店铺</a>
+            <a :href="'/supplier-'+GLOBAL_SHOP_ID+'.html'">查看店铺</a>
             <a href="/supplier/decoration.html">装扮主页</a>
             <a href="/supplier/release.html">发布商品</a>
             <a href="/supplier/goods.html">我的商品</a>
@@ -52,7 +52,7 @@
             <div class="centerList">
                 <span class="tab mIcon sh">我的店铺</span>
                 <div class="con">
-                    <a :href="'/supplier/'+GLOBAL_SHOP_ID+'.html'">查看店铺</a>
+                    <a :href="'/supplier-'+GLOBAL_SHOP_ID+'.html'">查看店铺</a>
                     <a href="/supplier/decoration.html">装扮主页</a>
                     <a href="/supplier/release.html">发布商品</a>
                     <a href="/supplier/goods.html">我的商品</a>

+ 3 - 3
src/main/resources/templates/supplier/list.html

@@ -28,10 +28,10 @@
     <ul v-else class="supplierList">
         <li class="supplierItem clear" v-for="shop in listData">
             <div class="left">
-                <a :href="'/supplier/'+shop.id+'.html'" target="_blank" class="logo">
+                <a :href="'/supplier-'+shop.id+'.html'" target="_blank" class="logo">
                     <img :src="shop.logo" onerror="javascript:this.src='/img/default/suppliver.jpg';">
                 </a>
-                <h5><a :href="'/supplier/'+shop.id+'.html'" :title="shop.name" target="_blank">
+                <h5><a :href="'/supplier-'+shop.id+'.html'" :title="shop.name" target="_blank">
                     <span v-html="shop.name"></span>
                 </a>
                 <a v-if="shop.license" :href="shop.license" target="_blank" class="icon mIcon shop"></a>
@@ -55,7 +55,7 @@
                     </template>
                     <li v-else-if="isPC" v-for="i in 3"></li>
                 </ul>
-                <a v-if="isPC" :href="'/supplier/'+shop.id+'.html'" target="_blank" class="four">进入本店铺>>></a>
+                <a v-if="isPC" :href="'/supplier-'+shop.id+'.html'" target="_blank" class="four">进入本店铺>>></a>
             </div>
         </li>
     </ul>

BIN=BIN
target/www-0.0.1-SNAPSHOT.jar