123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- <%@ page language="java" contentType="text/html; charset=UTF-8"
- pageEncoding="UTF-8"%>
- <%@ page isELIgnored="false" %>
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width,initial-scale=1">
- <meta name="description" content="">
- <meta name="author" content="">
- <title>登录员工部门管理系统</title>
- <!-- Bootstrap core css -->
- <link href="${pageContext.request.contextPath }/lib/css/bootstrap.min.css"
- rel="stylesheet">
- <!-- Custom style for this template -->
- <link href="${pageContext.request.contextPath }/lib/css/signin.css"
- rel="stylesheet">
- </head>
- <body>
- <div class="container">
- <form class="form-signin"
- action="${pageContext.request.contextPath }/signOn" method="post"
- onsubmit="return check()">
- <h2 class="form-signin-heading">员工部门后台系统登录</h2>
- <span style="color:red" id="message">${msg }</span>
- <label for="no" class="sr-only">用户账号</label>
- <input type="text" id="no" name="no" class="form-control" placeholder="
- 用户账号" required autofocus>
- <label for="password" class="sr-only">用户密码</label>
- <input type="password" id="password" name="password" class="form-control" placeholder="
- 用户密码" required>
- <div class="checkbox">
- <label>
- <input type="checkbox" value="remember-me" id="remember-me">记住我
- </label>
- </div>
- <button class="btn btn-lg btn-primary btn-block" type="submit">登录</button>
- <!-- <button class="btn btn-lg btn-primary btn-block" type="submit">注册</button> -->
- </form>
-
- </div><!-- /container -->
- <script src="${pageContext.request.contextPath }/lib/js/jquery.min.js"></script>
- <script src="${pageContext.request.contextPath }/lib/js/jquery.cookie.min.js"></script>
- <!-- 加载就执行 用于记住我功能 -->
- <script>
- $(document).ready(function(){
- if($.cookie('password')!=null){
- $("#password".val($.cookie("password")));
- }
- if($.cookie('no')!=null){
- $("#no".val($.cookie("no")));
- }
- });
- </script>
- <script>
- function check(){
- //记住我功能使用
- //写入cookie
- if($("#remember-me").prop("checked")==true){
- var no=$("#no").val();
- var password=$("#password").val();
- $.cookie('no',no,{expiree:7});
- $.cookie('password',password,{expiree:7});//存储一个带7天期限的cookie
- }else{
- $.cookie("no",null);
- $.cookie("password",null);
- }
- }
- </script>
- </body>
- </html>
|