From 02ab5ee48178ace59e380cac20f2b43c2736f826 Mon Sep 17 00:00:00 2001 From: tamguo Date: Fri, 13 Jul 2018 11:02:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tamguo/config/shiro/ShiroConfiguration.java | 1 + .../main/java/com/tamguo/model/MenuEntity.java | 7 +++---- .../java/com/tamguo/web/QuestionContrller.java | 16 ++++++++-------- tamguo/src/main/resources/templates/chapter.html | 2 +- .../main/resources/templates/include/header.html | 4 ++-- tamguo/src/main/resources/templates/index.html | 2 +- .../main/resources/templates/questionList.html | 8 ++++---- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/tamguo/src/main/java/com/tamguo/config/shiro/ShiroConfiguration.java b/tamguo/src/main/java/com/tamguo/config/shiro/ShiroConfiguration.java index bd3fef2..430d260 100644 --- a/tamguo/src/main/java/com/tamguo/config/shiro/ShiroConfiguration.java +++ b/tamguo/src/main/java/com/tamguo/config/shiro/ShiroConfiguration.java @@ -73,6 +73,7 @@ public class ShiroConfiguration { shiroFilterFactoryBean.setLoginUrl("/login"); shiroFilterFactoryBean.setSuccessUrl("/index"); filterChainDefinitionMap.put("/member/**", "authc"); + filterChainDefinitionMap.put("/**", "anon"); shiroFilterFactoryBean.setFilterChainDefinitionMap(filterChainDefinitionMap); return shiroFilterFactoryBean; } diff --git a/tamguo/src/main/java/com/tamguo/model/MenuEntity.java b/tamguo/src/main/java/com/tamguo/model/MenuEntity.java index 04f9ffe..9f41376 100644 --- a/tamguo/src/main/java/com/tamguo/model/MenuEntity.java +++ b/tamguo/src/main/java/com/tamguo/model/MenuEntity.java @@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.annotations.TableField; import com.baomidou.mybatisplus.annotations.TableName; import com.tamguo.config.dao.SuperEntity; -import java.math.BigInteger; import java.util.List; @@ -21,7 +20,7 @@ public class MenuEntity extends SuperEntity implements Serializable private String pinyin; - private BigInteger parentId; + private String parentId; private String isShow; @@ -46,11 +45,11 @@ public class MenuEntity extends SuperEntity implements Serializable this.name = name; } - public BigInteger getParentId() { + public String getParentId() { return this.parentId; } - public void setParentId(BigInteger parentId) { + public void setParentId(String parentId) { this.parentId = parentId; } diff --git a/tamguo/src/main/java/com/tamguo/web/QuestionContrller.java b/tamguo/src/main/java/com/tamguo/web/QuestionContrller.java index a0776a8..bbdb842 100644 --- a/tamguo/src/main/java/com/tamguo/web/QuestionContrller.java +++ b/tamguo/src/main/java/com/tamguo/web/QuestionContrller.java @@ -32,15 +32,15 @@ public class QuestionContrller { @Autowired private ICourseService iCourseService; - @RequestMapping(value = {"/question/{subjectId}/{courseId}/{parentChapterId}/{chapterId}-{offset}-{limit}.html"}, method = RequestMethod.GET) - public ModelAndView questionList(@PathVariable String subjectId , @PathVariable String courseId , - @PathVariable String parentChapterId ,@PathVariable String chapterId , @PathVariable Integer offset , + @RequestMapping(value = {"questionlist/{chapterId}-{offset}-{limit}"}, method = RequestMethod.GET) + public ModelAndView questionList(@PathVariable String chapterId , @PathVariable Integer offset , @PathVariable Integer limit , ModelAndView model){ model.setViewName("questionList"); - SubjectEntity subject = iSubjectService.find(subjectId); - CourseEntity course = iCourseService.find(courseId); + ChapterEntity chapter = iChapterService.findById(chapterId); - ChapterEntity parentChapter = iChapterService.findById(parentChapterId); + CourseEntity course = iCourseService.find(chapter.getCourseId()); + SubjectEntity subject = iSubjectService.find(course.getSubjectId()); + ChapterEntity parentChapter = iChapterService.findById(chapter.getParentId()); ChapterEntity nextChapter = iChapterService.findNextPoint(chapter.getParentId() , chapter.getOrders()); Page page = new Page<>(); @@ -53,8 +53,8 @@ public class QuestionContrller { model.addObject("parentChapter" , parentChapter); model.addObject("nextChapter" , nextChapter); model.addObject("questionList", questionList); - model.addObject("subjectId", subjectId); - model.addObject("courseId", courseId); + model.addObject("subjectId", course.getSubjectId()); + model.addObject("courseId", course.getUid()); return model; } diff --git a/tamguo/src/main/resources/templates/chapter.html b/tamguo/src/main/resources/templates/chapter.html index 1450237..e25c50c 100644 --- a/tamguo/src/main/resources/templates/chapter.html +++ b/tamguo/src/main/resources/templates/chapter.html @@ -129,7 +129,7 @@

diff --git a/tamguo/src/main/resources/templates/include/header.html b/tamguo/src/main/resources/templates/include/header.html index 281b22d..1a970f2 100644 --- a/tamguo/src/main/resources/templates/include/header.html +++ b/tamguo/src/main/resources/templates/include/header.html @@ -33,7 +33,7 @@