diff --git a/project2/README.md b/project2/README.md index ab520f7..be834dc 100644 --- a/project2/README.md +++ b/project2/README.md @@ -85,8 +85,8 @@ - 学生信息修改页(过时) [Get] - admin,teacher - studentMod|studentMod_t - - ~/modinfo [Post] - - 学生信息修改 + - ~/modinfo + - 学生信息修改 [Post] - admin,teacher - *Redirect*.infomodv2|*Redirect*.infomodv2_t - ~/infomodv2 diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/controller/CourseController.class b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/controller/CourseController.class index 076765b..e3f0fb3 100644 Binary files a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/controller/CourseController.class and b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/controller/CourseController.class differ diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/controller/PersonController.class b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/controller/PersonController.class index 30ece77..778ed67 100644 Binary files a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/controller/PersonController.class and b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/controller/PersonController.class differ diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/controller/ScoreController.class b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/controller/ScoreController.class index 5824c59..c095aac 100644 Binary files a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/controller/ScoreController.class and b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/controller/ScoreController.class differ diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/controller/StudentController.class b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/controller/StudentController.class index 7757778..578ddff 100644 Binary files a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/controller/StudentController.class and b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/controller/StudentController.class differ diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/controller/SystemController.class b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/controller/SystemController.class index c80506b..034803e 100644 Binary files a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/controller/SystemController.class and b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/controller/SystemController.class differ diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/controller/TeacherController.class b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/controller/TeacherController.class index ddf86c2..438c3fe 100644 Binary files a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/controller/TeacherController.class and b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/controller/TeacherController.class differ diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/controller/UserController.class b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/controller/UserController.class index c208864..1daea07 100644 Binary files a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/controller/UserController.class and b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/controller/UserController.class differ diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/controller/ViewController.class b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/controller/ViewController.class index eed6f75..4ed6bc8 100644 Binary files a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/controller/ViewController.class and b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/controller/ViewController.class differ diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/handler/CustomAuthenticationSuccessHandler.class b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/handler/CustomAuthenticationSuccessHandler.class index cf698d0..7c5d1b6 100644 Binary files a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/handler/CustomAuthenticationSuccessHandler.class and b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/handler/CustomAuthenticationSuccessHandler.class differ diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/mapper/ScoreDao.class b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/mapper/ScoreDao.class index 29e9e0d..154ad0b 100644 Binary files a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/mapper/ScoreDao.class and b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/mapper/ScoreDao.class differ diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/mapper/StudentDao.class b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/mapper/StudentDao.class index 6c8cb44..9b73b15 100644 Binary files a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/mapper/StudentDao.class and b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/mapper/StudentDao.class differ diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/mapper/impl/ScoreDaoImpl.class b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/mapper/impl/ScoreDaoImpl.class index e8fad18..5885825 100644 Binary files a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/mapper/impl/ScoreDaoImpl.class and b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/mapper/impl/ScoreDaoImpl.class differ diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/mapper/impl/StudentDaoImpl.class b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/mapper/impl/StudentDaoImpl.class index 0997484..89ba9b2 100644 Binary files a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/mapper/impl/StudentDaoImpl.class and b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/mapper/impl/StudentDaoImpl.class differ diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/service/CustomUserDetailsService.class b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/service/CustomUserDetailsService.class index 6a51040..0e8b63b 100644 Binary files a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/service/CustomUserDetailsService.class and b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/service/CustomUserDetailsService.class differ diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/service/ScoreService.class b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/service/ScoreService.class index 0ff5fbf..bb37fe1 100644 Binary files a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/service/ScoreService.class and b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/service/ScoreService.class differ diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/service/StudentService.class b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/service/StudentService.class index 068398e..9db65c6 100644 Binary files a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/service/StudentService.class and b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/service/StudentService.class differ diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/mapper/ScoreMapper.xml b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/mapper/ScoreMapper.xml index a858bc5..a922cd0 100644 --- a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/mapper/ScoreMapper.xml +++ b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/mapper/ScoreMapper.xml @@ -67,9 +67,10 @@ UPDATE score @@ -80,4 +81,21 @@ INSERT INTO score (Score, StudentID, CourseID) VALUES (#{score}, #{student.id}, #{course.courseID}); + + + + + + \ No newline at end of file diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/mapper/StudentMapper.xml b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/mapper/StudentMapper.xml index 9c67cf2..f6a1813 100644 --- a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/mapper/StudentMapper.xml +++ b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/mapper/StudentMapper.xml @@ -70,9 +70,22 @@ VALUES (#{name}, #{birthday}, #{sex}, #{phone}, #{classes}) - + + + + + diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/spring-security.xml b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/spring-security.xml index b1c87ab..9c07e3e 100644 --- a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/spring-security.xml +++ b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/spring-security.xml @@ -20,16 +20,36 @@ - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> + + + + + + + + 课程信息查看 + + + + + + + + + + +
+ +
+ + + + +
+
+
+
+
+
+
+ +
+
+
+
+ +
+
+
+
+ + + + + + + + + + + + + + + + + +
课程ID课程名课程描述
${course.courseID}${course.courseName}${course.description}
+
+
+
+
+
+ + + + +
+
+ + + + + + + + + \ No newline at end of file diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/views/course/courseList_t.jsp b/project2/out/artifacts/project2_war_exploded/WEB-INF/views/course/courseList_t.jsp index d750cef..8228271 100644 --- a/project2/out/artifacts/project2_war_exploded/WEB-INF/views/course/courseList_t.jsp +++ b/project2/out/artifacts/project2_war_exploded/WEB-INF/views/course/courseList_t.jsp @@ -47,7 +47,7 @@ @@ -133,7 +113,7 @@
-
diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/views/course/courseQueryResult.jsp b/project2/out/artifacts/project2_war_exploded/WEB-INF/views/course/courseQueryResult.jsp index 60d8e97..c715a2c 100644 --- a/project2/out/artifacts/project2_war_exploded/WEB-INF/views/course/courseQueryResult.jsp +++ b/project2/out/artifacts/project2_war_exploded/WEB-INF/views/course/courseQueryResult.jsp @@ -47,7 +47,7 @@
- -
-
@@ -223,113 +188,7 @@
-
-
-
-
-
-
- - -
-
-
-
-
-
- - -
-
-
-
-
-
- - -
-
-
-
-
- -
-
- -
-
-
-
-
-
-
-
-
-
-
- - -
-
-
-
-
- -
-
- -
-
-
-
- -
-
- -
-
-
-
-
- - -
-
-
-
-
-
- - -
-
-
-
-
- -
-
- -
-
-
-
- -
- -
diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/views/dashboard.jsp b/project2/out/artifacts/project2_war_exploded/WEB-INF/views/dashboard/dashboard.jsp similarity index 100% rename from project2/out/artifacts/project2_war_exploded/WEB-INF/views/dashboard.jsp rename to project2/out/artifacts/project2_war_exploded/WEB-INF/views/dashboard/dashboard.jsp diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/views/dashboard_s.jsp b/project2/out/artifacts/project2_war_exploded/WEB-INF/views/dashboard/dashboard_s.jsp similarity index 94% rename from project2/out/artifacts/project2_war_exploded/WEB-INF/views/dashboard_s.jsp rename to project2/out/artifacts/project2_war_exploded/WEB-INF/views/dashboard/dashboard_s.jsp index 6e7d9ff..abbac8f 100644 --- a/project2/out/artifacts/project2_war_exploded/WEB-INF/views/dashboard_s.jsp +++ b/project2/out/artifacts/project2_war_exploded/WEB-INF/views/dashboard/dashboard_s.jsp @@ -41,7 +41,6 @@ diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/views/dashboard_t.jsp b/project2/out/artifacts/project2_war_exploded/WEB-INF/views/dashboard/dashboard_t.jsp similarity index 88% rename from project2/out/artifacts/project2_war_exploded/WEB-INF/views/dashboard_t.jsp rename to project2/out/artifacts/project2_war_exploded/WEB-INF/views/dashboard/dashboard_t.jsp index ab306c9..7531e20 100644 --- a/project2/out/artifacts/project2_war_exploded/WEB-INF/views/dashboard_t.jsp +++ b/project2/out/artifacts/project2_war_exploded/WEB-INF/views/dashboard/dashboard_t.jsp @@ -40,14 +40,14 @@ 学生管理 diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/views/fail.jsp b/project2/out/artifacts/project2_war_exploded/WEB-INF/views/fail.jsp index 09fefb4..0c4c583 100644 --- a/project2/out/artifacts/project2_war_exploded/WEB-INF/views/fail.jsp +++ b/project2/out/artifacts/project2_war_exploded/WEB-INF/views/fail.jsp @@ -1,4 +1,4 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> +<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/views/login.jsp b/project2/out/artifacts/project2_war_exploded/WEB-INF/views/login.jsp index 707a07b..e5679b2 100644 --- a/project2/out/artifacts/project2_war_exploded/WEB-INF/views/login.jsp +++ b/project2/out/artifacts/project2_war_exploded/WEB-INF/views/login.jsp @@ -15,14 +15,10 @@ - - - <% if (new UsernameHelper().getCurrentUsername() != null) { - //redirect /dashboard //note: 登陆了的就别乱访问了 response.sendRedirect("dashboard"); } @@ -239,10 +235,12 @@ $('#exampleModal2').modal('show'); }); + function showNote() { alert("功能尚未实现,请联系管理员重置密码"); } - function showReg(){ + + function showReg() { document.getElementById("tab-register").click(); } diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/views/person.jsp b/project2/out/artifacts/project2_war_exploded/WEB-INF/views/person/person.jsp similarity index 85% rename from project2/out/artifacts/project2_war_exploded/WEB-INF/views/person.jsp rename to project2/out/artifacts/project2_war_exploded/WEB-INF/views/person/person.jsp index 4d3842a..fadd922 100644 --- a/project2/out/artifacts/project2_war_exploded/WEB-INF/views/person.jsp +++ b/project2/out/artifacts/project2_war_exploded/WEB-INF/views/person/person.jsp @@ -39,7 +39,7 @@ diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/views/studentinfomodv2.jsp b/project2/out/artifacts/project2_war_exploded/WEB-INF/views/student/studentinfomodv2.jsp similarity index 100% rename from project2/out/artifacts/project2_war_exploded/WEB-INF/views/studentinfomodv2.jsp rename to project2/out/artifacts/project2_war_exploded/WEB-INF/views/student/studentinfomodv2.jsp diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/views/studentinfomodv2_t.jsp b/project2/out/artifacts/project2_war_exploded/WEB-INF/views/student/studentinfomodv2_t.jsp similarity index 90% rename from project2/out/artifacts/project2_war_exploded/WEB-INF/views/studentinfomodv2_t.jsp rename to project2/out/artifacts/project2_war_exploded/WEB-INF/views/student/studentinfomodv2_t.jsp index 505d919..c6daf00 100644 --- a/project2/out/artifacts/project2_war_exploded/WEB-INF/views/studentinfomodv2_t.jsp +++ b/project2/out/artifacts/project2_war_exploded/WEB-INF/views/student/studentinfomodv2_t.jsp @@ -50,7 +50,7 @@ @@ -256,7 +236,7 @@
-
+
diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/views/success.jsp b/project2/out/artifacts/project2_war_exploded/WEB-INF/views/success.jsp index 2e29ab8..6921c93 100644 --- a/project2/out/artifacts/project2_war_exploded/WEB-INF/views/success.jsp +++ b/project2/out/artifacts/project2_war_exploded/WEB-INF/views/success.jsp @@ -1,4 +1,4 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> +<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/views/settings.jsp b/project2/out/artifacts/project2_war_exploded/WEB-INF/views/system/settings.jsp similarity index 100% rename from project2/out/artifacts/project2_war_exploded/WEB-INF/views/settings.jsp rename to project2/out/artifacts/project2_war_exploded/WEB-INF/views/system/settings.jsp diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/views/teacherQueryResult.jsp b/project2/out/artifacts/project2_war_exploded/WEB-INF/views/teacher/teacherQueryResult.jsp similarity index 100% rename from project2/out/artifacts/project2_war_exploded/WEB-INF/views/teacherQueryResult.jsp rename to project2/out/artifacts/project2_war_exploded/WEB-INF/views/teacher/teacherQueryResult.jsp diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/views/teachermanage.jsp b/project2/out/artifacts/project2_war_exploded/WEB-INF/views/teacher/teachermanage.jsp similarity index 100% rename from project2/out/artifacts/project2_war_exploded/WEB-INF/views/teachermanage.jsp rename to project2/out/artifacts/project2_war_exploded/WEB-INF/views/teacher/teachermanage.jsp diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/views/usermanage.jsp b/project2/out/artifacts/project2_war_exploded/WEB-INF/views/user/usermanage.jsp similarity index 98% rename from project2/out/artifacts/project2_war_exploded/WEB-INF/views/usermanage.jsp rename to project2/out/artifacts/project2_war_exploded/WEB-INF/views/user/usermanage.jsp index 4e86bb7..7cb779b 100644 --- a/project2/out/artifacts/project2_war_exploded/WEB-INF/views/usermanage.jsp +++ b/project2/out/artifacts/project2_war_exploded/WEB-INF/views/user/usermanage.jsp @@ -430,8 +430,7 @@ $('#de_button').on('click', function () { reloadka("reload"); }); - $('#exampleModal3').modal('show'); - $('#exampleModal3').on('hidden.bs.modal', function () { //针对点击modal外的情况的处理 + $('#exampleModal3').modal('show').on('hidden.bs.modal', function () { //针对点击modal外的情况的处理 reloadka("reload"); }); } else { @@ -463,8 +462,7 @@ $('#de_button').on('click', function () { reloadka("reload"); }); - $('#exampleModal3').modal('show'); - $('#exampleModal3').on('hidden.bs.modal', function () { + $('#exampleModal3').modal('show').on('hidden.bs.modal', function () { reloadka("reload"); }); } else { diff --git a/project2/src/main/java/cyou/chenx221/handler/CustomAuthenticationSuccessHandler.java b/project2/src/main/java/cyou/chenx221/handler/CustomAuthenticationSuccessHandler.java index 766e212..36a4c81 100644 --- a/project2/src/main/java/cyou/chenx221/handler/CustomAuthenticationSuccessHandler.java +++ b/project2/src/main/java/cyou/chenx221/handler/CustomAuthenticationSuccessHandler.java @@ -19,19 +19,19 @@ public class CustomAuthenticationSuccessHandler extends SimpleUrlAuthenticationS // 移除 errorMessage 属性 request.getSession().removeAttribute("errorMessage"); - Collection authorities = authentication.getAuthorities(); - for (GrantedAuthority authority : authorities) { - if (authority.getAuthority().equals("ROLE_admin")) { - response.sendRedirect("/dashboard"); - return; - } else if (authority.getAuthority().equals("ROLE_teacher")) { - response.sendRedirect("/dashboard-t"); - return; - } else if (authority.getAuthority().equals("ROLE_student")) { - response.sendRedirect("/dashboard-s"); - return; - } - } +// Collection authorities = authentication.getAuthorities(); +// for (GrantedAuthority authority : authorities) { +// if (authority.getAuthority().equals("ROLE_admin")) { +// response.sendRedirect("/dashboard"); +// return; +// } else if (authority.getAuthority().equals("ROLE_teacher")) { +// response.sendRedirect("/dashboard-t"); +// return; +// } else if (authority.getAuthority().equals("ROLE_student")) { +// response.sendRedirect("/dashboard-s"); +// return; +// } +// } // 如果没有匹配的角色,或者无法确定跳转的目标页面,则默认跳转到 "/dashboard" super.onAuthenticationSuccess(request, response, authentication); } diff --git a/project2/src/main/java/cyou/chenx221/service/CustomUserDetailsService.java b/project2/src/main/java/cyou/chenx221/service/CustomUserDetailsService.java index c8ab566..1674b7f 100644 --- a/project2/src/main/java/cyou/chenx221/service/CustomUserDetailsService.java +++ b/project2/src/main/java/cyou/chenx221/service/CustomUserDetailsService.java @@ -3,6 +3,7 @@ package cyou.chenx221.service; import cyou.chenx221.mapper.UserMapper; import cyou.chenx221.pojo.User; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.authentication.DisabledException; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.core.userdetails.UsernameNotFoundException; @@ -24,6 +25,9 @@ public class CustomUserDetailsService implements UserDetailsService { if (user == null) { throw new UsernameNotFoundException("X User not found with username: " + username); } + if(user.getDisabled()==1){ + throw new DisabledException("User is disabled"); + } System.out.println(user.getId()+" "+user.getUsername()+" "+user.getPassword()+" "+user.getRoles()); // 创建并返回自定义的UserDetails对象 return org.springframework.security.core.userdetails.User.builder() diff --git a/project2/src/main/resources/mapper/ScoreMapper.xml b/project2/src/main/resources/mapper/ScoreMapper.xml index 2f49b29..a922cd0 100644 --- a/project2/src/main/resources/mapper/ScoreMapper.xml +++ b/project2/src/main/resources/mapper/ScoreMapper.xml @@ -85,14 +85,16 @@ - + SELECT ScoreID, Score, st.id as student_id, st.name as name, c.CourseID, c.CourseName + FROM score s + JOIN student st ON s.StudentID = st.id + JOIN course c ON s.CourseID = c.CourseID WHERE invalid = 0 AND StudentID = #{id}; diff --git a/project2/src/main/resources/spring-security.xml b/project2/src/main/resources/spring-security.xml index b1c87ab..9c07e3e 100644 --- a/project2/src/main/resources/spring-security.xml +++ b/project2/src/main/resources/spring-security.xml @@ -20,16 +20,36 @@ - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + +
-
diff --git a/project2/web/WEB-INF/views/course/courseList_t.jsp b/project2/web/WEB-INF/views/course/courseList_t.jsp index 157f786..8228271 100644 --- a/project2/web/WEB-INF/views/course/courseList_t.jsp +++ b/project2/web/WEB-INF/views/course/courseList_t.jsp @@ -113,7 +113,7 @@
-
diff --git a/project2/web/WEB-INF/views/person/person.jsp b/project2/web/WEB-INF/views/person/person.jsp index 2808bbd..fadd922 100644 --- a/project2/web/WEB-INF/views/person/person.jsp +++ b/project2/web/WEB-INF/views/person/person.jsp @@ -146,7 +146,7 @@
-
@@ -243,7 +243,7 @@ contentType: false, // 告诉jQuery不要设置Content-Type请求头 success: function () { $('#default_avatar').hide(); // 隐藏默认头像 - $('#custom_avatar').show(); // 显示自定义头像 + $('#custom_avatar').attr('src', "/person/image").show(); $('#note').show(); // 显示提示消息 }, error: function (xhr, status, error) { diff --git a/project2/web/WEB-INF/views/person/person_s.jsp b/project2/web/WEB-INF/views/person/person_s.jsp index 0ea9474..e782b74 100644 --- a/project2/web/WEB-INF/views/person/person_s.jsp +++ b/project2/web/WEB-INF/views/person/person_s.jsp @@ -129,7 +129,7 @@
-
@@ -226,7 +226,7 @@ contentType: false, // 告诉jQuery不要设置Content-Type请求头 success: function () { $('#default_avatar').hide(); // 隐藏默认头像 - $('#custom_avatar').show(); // 显示自定义头像 + $('#custom_avatar').attr('src', "/person/image").show(); $('#note').show(); // 显示提示消息 }, error: function (xhr, status, error) { diff --git a/project2/web/WEB-INF/views/person/person_t.jsp b/project2/web/WEB-INF/views/person/person_t.jsp index aadb331..00f5330 100644 --- a/project2/web/WEB-INF/views/person/person_t.jsp +++ b/project2/web/WEB-INF/views/person/person_t.jsp @@ -132,7 +132,7 @@
-
@@ -229,7 +229,7 @@ contentType: false, // 告诉jQuery不要设置Content-Type请求头 success: function () { $('#default_avatar').hide(); // 隐藏默认头像 - $('#custom_avatar').show(); // 显示自定义头像 + $('#custom_avatar').attr('src', "/person/image").show(); $('#note').show(); // 显示提示消息 }, error: function (xhr, status, error) { diff --git a/project2/web/WEB-INF/views/score/scoreList_s.jsp b/project2/web/WEB-INF/views/score/scoreList_s.jsp index 1493d43..a69e301 100644 --- a/project2/web/WEB-INF/views/score/scoreList_s.jsp +++ b/project2/web/WEB-INF/views/score/scoreList_s.jsp @@ -110,7 +110,7 @@
-
diff --git a/project2/web/WEB-INF/views/score/scoreList_t.jsp b/project2/web/WEB-INF/views/score/scoreList_t.jsp index 158856b..c1bfcbe 100644 --- a/project2/web/WEB-INF/views/score/scoreList_t.jsp +++ b/project2/web/WEB-INF/views/score/scoreList_t.jsp @@ -113,7 +113,7 @@
-
diff --git a/project2/web/WEB-INF/views/score/scoreopv2_t.jsp b/project2/web/WEB-INF/views/score/scoreopv2_t.jsp index 64729c4..e085312 100644 --- a/project2/web/WEB-INF/views/score/scoreopv2_t.jsp +++ b/project2/web/WEB-INF/views/score/scoreopv2_t.jsp @@ -113,7 +113,7 @@ style="background-image: url('${pageContext.request.contextPath}/resources/img/jason-blackeye-nyL-rzwP-Mk-unsplash.jpg'); margin-top: -58.59px;">
- +
diff --git a/project2/web/WEB-INF/views/student/studentList_s.jsp b/project2/web/WEB-INF/views/student/studentList_s.jsp index d1f51e6..85bafc7 100644 --- a/project2/web/WEB-INF/views/student/studentList_s.jsp +++ b/project2/web/WEB-INF/views/student/studentList_s.jsp @@ -110,7 +110,7 @@
-
diff --git a/project2/web/WEB-INF/views/student/studentList_t.jsp b/project2/web/WEB-INF/views/student/studentList_t.jsp index ccaeb87..e491756 100644 --- a/project2/web/WEB-INF/views/student/studentList_t.jsp +++ b/project2/web/WEB-INF/views/student/studentList_t.jsp @@ -113,7 +113,7 @@
-