Selaa lähdekoodia

帮助中心404优化

chao 4 vuotta sitten
vanhempi
commit
17e2629837

+ 4 - 2
src/main/java/com/caimei/www/controller/unlimited/HelpPageController.java

@@ -31,9 +31,11 @@ public class HelpPageController extends BaseController {
      */
     @GetMapping("/help/{id}.html")
     public String help(final Model model, @PathVariable Integer id ) {
-        // 默认平台介绍
-        if(null == id) {id = 1016;}
         PageContent helpPage = helpService.getHelpPageById(id);
+        if(null == helpPage){
+            // 默认平台介绍
+            return "redirect:/help/1016.html";
+        }
         model.addAttribute("pageId", id);
         model.addAttribute("pageTypeId", helpPage.getType());
         model.addAttribute("pageInfo", helpPage);