This commit is contained in:
awin-x 2024-12-05 13:37:25 +08:00
parent 5a27235897
commit 8170cb39ad
6 changed files with 8 additions and 11 deletions

View File

@ -2,10 +2,10 @@
Created by IntelliJ IDEA. Created by IntelliJ IDEA.
User: awinx User: awinx
Date: 2024/12/5 Date: 2024/12/5
Time: 下午1:31 Time: <EFBFBD><EFBFBD><EFBFBD><EFBFBD>1:31
To change this template use File | Settings | File Templates. To change this template use File | Settings | File Templates.
--%> --%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ page contentType="text/html;charset=UTF-8"%>
<html> <html>
<head> <head>
<title>$Title$</title> <title>$Title$</title>

View File

@ -11,7 +11,7 @@ import java.io.IOException;
@WebServlet("/UserLoginAction") @WebServlet("/UserLoginAction")
public class UserLoginAction extends HttpServlet { public class UserLoginAction extends HttpServlet {
protected void doPost(HttpServletRequest req, HttpServletResponse response) throws ServletException, IOException { protected void doPost(HttpServletRequest req, HttpServletResponse response) throws IOException {
String path = req.getContextPath(); String path = req.getContextPath();
if (req.getSession().getAttribute("user") != null){ if (req.getSession().getAttribute("user") != null){
response.sendRedirect(path+"/home.jsp"); response.sendRedirect(path+"/home.jsp");
@ -28,7 +28,7 @@ public class UserLoginAction extends HttpServlet {
response.sendRedirect(path+"/login/login.jsp&loginflag=2"); response.sendRedirect(path+"/login/login.jsp&loginflag=2");
} }
} }
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
response.sendRedirect("error.jsp"); response.sendRedirect("error.jsp");
} }
} }

View File

@ -5,7 +5,7 @@
Time: 上午12:17 Time: 上午12:17
To change this template use File | Settings | File Templates. To change this template use File | Settings | File Templates.
--%> --%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ page contentType="text/html;charset=UTF-8" %>
<html> <html>
<head> <head>
<title>主页</title> <title>主页</title>

View File

@ -5,7 +5,7 @@
Time: 下午1:20 Time: 下午1:20
To change this template use File | Settings | File Templates. To change this template use File | Settings | File Templates.
--%> --%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ page contentType="text/html;charset=UTF-8"%>
<html> <html>
<head> <head>
<title>学生信息管理系统</title> <title>学生信息管理系统</title>

View File

@ -35,10 +35,7 @@ function getCourses(){
$(document).ready(getCourses); $(document).ready(getCourses);
function editCourse(i){ function editCourse(i){
$(".course-editor").load(path+"/course/course_edit.jsp", (response,status,xhr)=>{ $(".course-editor").load(path+"/course/course_edit.jsp", ()=>{
if (stauts === 403){
window.location = path+"/login/login.jsp";
}
const form = document.querySelector('.course-edit'); const form = document.querySelector('.course-edit');
form.action = path+"/CourseEditAction"; form.action = path+"/CourseEditAction";
form.method = "POST"; form.method = "POST";

View File

@ -5,7 +5,7 @@
Time: 下午11:58 Time: 下午11:58
To change this template use File | Settings | File Templates. To change this template use File | Settings | File Templates.
--%> --%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ page contentType="text/html;charset=UTF-8"%>
<html> <html>
<head> <head>
<title>登录</title> <title>登录</title>