Files
HRS/SMMS/WebContent/view/login.jsp

64 lines
2.4 KiB
Plaintext
Raw Normal View History

2026-04-01 07:43:05 +08:00
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>学生信息管理系统</title>
<link rel="stylesheet" href="static/css/login.css">
<script type="text/javascript" src="static/easyui/jquery.min.js"></script>
<script type="text/javascript" src="static/h-ui/js/H-ui.js"></script>
<script type="text/javascript" src="static/h-ui/lib/icheck/jquery.icheck.min.js"></script>
<script type="text/javascript" src="static/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript">
$(function(){
$("#submitBtn").click(function(){
var data = $("#loginForm").serialize();
$.ajax({
type: "post",
url: "LoginServlet?method=Login",
data: data,
dataType: "text", //返回数据类型
success: function(msg){
if("loginError" == msg){
alert("用户名或密码错误!");
} else if("loginSuccess" == msg){
window.location.href = "SystemServlet?method=toAdminView";
} else{
alert(msg);
}
}
});
});
})
</script>
</head>
<body>
<div class="login-container">
<h1 class="login-title">学生信息管理系统</h1>
<div style="color: #e74c3c; font-size: 18px; margin-top: 5px; ont-family: 'Microsoft YaHei', sans-serif;">
<%=request.getAttribute("msg") == null ? "" : request.getAttribute("msg")%>
</div>
<form id="loginForm" method="post">
<div class="form-group">
<label for="username">用户名</label>
<input type="text" id="username" name="username" placeholder="请输入用户名">
<div id="usernameError" class="error-message"></div>
</div>
<div class="form-group">
<label for="password">密码</label>
<input type="password" id="password" name="password" placeholder="请输入密码">
<div id="passwordError" class="error-message"></div>
</div>
<div class="remember-me">
<input type="checkbox" id="remember" name="remember">
<label for="remember">记住我</label>
</div>
<button id="submitBtn" type="button" class="login-btn">登录</button>
</form>
</div>
<script src="static/js/login.js"></script>
</body>
</html>