第二阶段冲刺

登录注册页面的完善

login.jsp

<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>

<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>学习通- 登录界面</title>

    <link rel="shortcut icon" href="favicon.ico"> <link href="css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="css/font-awesome.css?v=4.4.0" rel="stylesheet">

    <link href="css/animate.css" rel="stylesheet">
    <link href="css/style.css?v=4.1.0" rel="stylesheet">
    <script>if(window.top !== window.self){ window.top.location = window.location;}</script>
</head>
  <style>
    .container {
      width: 310px;
      margin: 100px auto;
    }
   
    #msg {
      width: 100%;
      line-height: 40px;
      font-size: 14px;
      text-align: center;
    }
   

  </style>
  <%
	     Object message = session.getAttribute("messagel");
	     if(message!=null && !"".equals(message)){
	 
	%>
	     <script type="text/javascript">
	          alert("<%=message%>");
	     </script>
	<%} 
	     session.setAttribute("messagel", "");%>
<body class="gray-bg">

    <div class="middle-box text-center loginscreen  animated fadeInDown">
        <div>
            <div>

                <h1 class="logo-name">L</h1>

            </div>
            <h3>欢迎使用 作业通</h3>

            <form class="m-t"  action="login" method="post" onsubmit="return check()">
               <div class="form-group">
                    <input type="text" name="id" id="id" class="form-control" placeholder="学生号/职工号"  required="">
                </div>
                <div class="form-group">
                    <input type="password" name="password" id="password" class="form-control" placeholder="密码"  required="">
                </div>
                <div class="form-group" id='yan'>
               <div id="captcha"></div>
  				<div id="msg"></div></div>
                <button type="submit" class="btn btn-primary  full-width m-b">登 录</button>
                

            </form> <p class="text-muted text-center"> <a href="#"><small>忘记密码了?</small></a> | <a href="register.jsp">注册一个新账号</a>
                </p>
        
        
        </div>
    </div>

    <!-- 全局js -->
    <script src="js/jquery.min.js?v=2.1.4"></script>
    <script src="js/bootstrap.min.js?v=3.3.6"></script>
<script src="./dist/jigsaw.min.js"></script>
    <script type="text/javascript" src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script>
    <!--统计代码,可删除-->
<script type="text/javascript">
x=0;
  function cleanMsg() {
    document.getElementById('msg').innerHTML = ''
  }
        function check() {
 $('#yan').html(' <div id="captcha"></div><div id="msg"></div>')

 jigsaw.init({
    el: document.getElementById('captcha'),
    onSuccess: function() {
      document.getElementById('msg').innerHTML = '验证成功!'
      x=1;
    },
    onFail:function() {
      
    	  cleanMsg()
    	  x=0;
    } ,
    onRefresh:function() {
     
    	  cleanMsg()
    	  x=0;
    } 
  })
<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>注册</title>

    <link rel="shortcut icon" href="favicon.ico"> <link href="css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="css/animate.css" rel="stylesheet">
    <link href="css/style.css?v=4.1.0" rel="stylesheet">
    <script>if(window.top !== window.self){ window.top.location = window.location;}</script>

</head>

<body class="gray-bg">

    <div class="middle-box text-center loginscreen   animated fadeInDown">
        <div>
            <div>
<div>

                <h1 class="logo-name">L</h1>

            </div>
               

            </div>
            <h3>欢迎注册 </h3>
            <p>创建一个新账户</p>
          <p class="text-muted text-center"> <a href="rt.jsp">创建教师帐户</a>  </p>
          <p>
          <a href="rs.jsp">创建学生帐户</a>
                </p>

           
        </div>
    </div>
<script src="./dist/jigsaw.min.js"></script>
    <!-- 全局js -->
    <script src="js/jquery.min.js?v=2.1.4"></script>
    <script src="js/bootstrap.min.js?v=3.3.6"></script>
    <!-- iCheck -->
    <script src="js/plugins/iCheck/icheck.min.js"></script>
    <script>
        $(document).ready(function () {
        
        		  
        		
        	
            $('.i-checks').iCheck({
                checkboxClass: 'icheckbox_square-green',
                radioClass: 'iradio_square-green',
            });
            
            
            jigsaw.init({
                el: document.getElementById('captcha'),
                onSuccess: function() {
                  document.getElementById('msg').innerHTML = '登录成功!'
                },
                onFail: cleanMsg,
                onRefresh: cleanMsg
              })
              function cleanMsg() {
                document.getElementById('msg').innerHTML = ''
              }
        });
       
    </script>

    <script type="text/javascript" src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script>
    <!--统计代码,可删除-->

</body>

</html>

  

if(x==1)return true; else return false; } </script> </body> </html>

  registetr.jsp

posted @ 2020-05-30 16:35  kai_kaikai  阅读(94)  评论(0编辑  收藏  举报