hau преди 2 години
родител
ревизия
5a8c094e34
променени са 1 файла, в които са добавени 3 реда и са изтрити 2 реда
  1. 3 2
      src/main/java/com/caimei/www/controller/unlimited/ProductController.java

+ 3 - 2
src/main/java/com/caimei/www/controller/unlimited/ProductController.java

@@ -101,8 +101,8 @@ public class ProductController extends BaseController {
     /**
      * 商品详情页
      */
-    @GetMapping("/product-{id}.html")
-    public String detail(final Model model, @PathVariable("id") Integer productId) {
+    @GetMapping("/product-{id}-{typeId}.html")
+    public String detail(final Model model, @PathVariable("id") Integer productId, @PathVariable("typeId") Integer typeId) {
         ProductDetail detail = productService.getProductDetailById(productId);
         if (detail == null || detail.getValidFlag() == 0 || detail.getValidFlag() == 9) {
             return super.errorPath();
@@ -115,6 +115,7 @@ public class ProductController extends BaseController {
         model.addAttribute("images",images);
         model.addAttribute("productId", productId);
         model.addAttribute("product", detail);
+        model.addAttribute("typeId",typeId);
         return PRODUCT_DETAIL_PATH;
     }