Quellcode durchsuchen

商品不可见跳转404

chao vor 4 Jahren
Ursprung
Commit
88b3681a1b
1 geänderte Dateien mit 4 neuen und 1 gelöschten Zeilen
  1. 4 1
      src/main/resources/static/js/product/detail.js

+ 4 - 1
src/main/resources/static/js/product/detail.js

@@ -257,7 +257,10 @@ var productDetail = new Vue({
         // visibility:3:所有人可见,2:普通机构可见,1:会员机构可见
         var visible = $("#productVisibility").val()*1;
         var identity = GLOBAL_USER_IDENTITY;
-        this.showProduct = (identity === 1 || identity === 2) || (identity === 4 && (visible === 2 || visible === 3)) || (visible === 3);
+        this.showProduct = visible === 3 || identity === 1 || identity === 2 || (identity === 4 && visible === 2);
+        if(!this.showProduct) {
+            window.location.href = "/404.html?error=未查询到该商品";
+        }
     },
     mounted: function () {
         this.userId = GLOBAL_USER_ID;