123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219 |
- <%@ page language="java" contentType="text/html; charset=UTF-8"
- pageEncoding="UTF-8"%>
- <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
- <% String basePath = request.getScheme()+ "://" + request.getServerName() + ":" +request.getServerPort() + request.getContextPath(); %>
- <% String contextPath = request.getContextPath() ;%>
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <title>淮安市住房保障管理系统</title>
- <link href="<%=basePath %>/favicon.ico" rel="shortcut icon" type="image/x-icon"/>
- <script type="text/javascript" src="<%=basePath %>/js/jquery-1.8.0.min.js"></script>
- <script type="text/javascript" src="<%=basePath %>/js/md5.js"></script>
- <script src="<%=basePath %>/js/sm2/crypto-js.js"></script>
- <script src="<%=basePath %>/js/sm2/sm2.js"></script>
- <style type="text/css">
-
- .login_body{
- background: url(images/login.png) no-repeat 0 -1px;
- width: 1340px;
- height: 746px;
- margin: 0 auto;
- *margin-top:-1px;
- border:1px solid transparent;
- }
-
- .login_form{
- width:350px;
- height: 180px;
- margin-top:270px;
- margin-left:820px;
- border:1px solid transparent;
- }
-
- .login_btn{
- width: 240px;
- height: 40px;
- background: url(images/login_btn.png);
- border: 0px;
- margin-left: 60px;
- }
-
- .error{
- color: red;
- height:16px;
- font-size: 12px;
- padding-left: 16px;
- }
-
- .label{
- float: left;
- position: absolute;
- margin-left: 38px;
- margin-top:11px;
- color: #999;
- font-size: 12px;
- line-height: 18px;
- cursor: text;
- }
-
- .text {
- width: 230px;
- height: 16px;
- border: 1px solid #B0B0B0;
- line-height: 14px;
- padding: 11px 16px 11px 45px;
- color: #333;
- font-size: 12px;
- margin-left: 30px;
- }
- </style>
- <style type="text/css">
- .yzm{
- cursor:pointer;
- background-position:center;
- background-image:url(<%=basePath %>/userAction_checkCode);
- background-repeat:no-repeat;
- font-size:20px;
- line-height:35px;
- width:80px;
- height:35px;
- float:right;
- }
- </style>
- <jsp:include page="../common/include.jsp"></jsp:include>
- <script type="text/javascript">
- const pubkeyHex = '04997d6804e85932b7adcf9c10641b3cee749d79fb7460c9e37431f3b27aa8a1b65d43aaa98dcf564562bab2538a187d6a334436e124d41c7bcd5b2384ca76146a';
- const cipherMode = 1;
- function auto_login(){
- if(event.keyCode==13) {
- login();
- }
- }
-
- function login(){
- if($("#userName").val() == ""){
- $("#login_error").text("");
- $("#error").text("账户不能为空");
- $("#error").show();
- return ;
- }else{
- $("#error").hide();
- }
- if($("#userPassword").val() == ""){
- $("#login_error").text("");
- $("#error").text("密码不能为空");
- $("#error").show();
- return ;
- }else{
- $("#error").hide();
- }
- if($("#yzm").val() == ""){
- $("#login_error").text("");
- $("#error").text("验证码不能为空");
- $("#error").show();
- return ;
- }else{
- $("#error").hide();
- }
- //$("#userName").val(sm2Encrypt($("#userName").val(), pubkeyHex, cipherMode));
- //$("#userPassword").val(sm2Encrypt($("#userPassword").val(), pubkeyHex, cipherMode));
- var password = $("#userPassword").val();
- var passwordMd5 = hex_md5(password);
- //console.log(passwordMd5);
- $("#userPassword").val(passwordMd5)
- $.messager.progress({
- text : '登录中,请稍后....'
- });
- $("#loginForm").submit();
- }
-
- var t ;
- function getPWD(){
- if($("#userName").val() == ""){
- $("#login_error").text("");
- $("#error").text("账户不能为空");
- $("#error").show();
- return ;
- }else{
- var count = $("#pwd").text();
- if("获取密码" == count){
- $("#pwd").text(60);
- t=setTimeout("countSecond()",1000);
- //工作任务状态
- $.ajax({
- type: "post",//使用post方法访问后台
- dataType: "json",//返回json格式的数据
- url: "userAction_sms",//要访问的后台地址
- data:{"user.phone":$("#userName").val()},
- success: function(msg){//msg为返回的数据,在这里做数据绑定
- if(msg.success){
-
- }else{
- $.messager.alert('提示',msg.message);
- //stopCount();
- }
- }
- });
- }
- }
- }
-
- function countSecond(){
- var count = $("#pwd").text();
- count = count - 1;
- if(count == 0){
- $("#pwd").text("获取密码");
- }else{
- $("#pwd").text(count);
- t = setTimeout("countSecond()",1000);
- }
- }
- function stopCount(){
- clearTimeout(t);
- $("#pwd").text("获取密码");
- }
-
- </script>
- </head>
- <body style="margin:0px; background-color: #e7fbff;background: url(images/bg_01.png) repeat-x;"" onkeydown="auto_login()">
- <div class="login_body">
- <div class="login_form">
- <form id="loginForm" action="userAction_login" method="post">
- <div style="height: 20px; width: 100%; margin-left:auto;margin-right:auto;text-align:center; border:1px solid transparent;margin-top: 5px;">
- <c:if test="${loginError != null }">
- <span id="login_error" class="error">${loginError}</span>
- </c:if>
- <span class="error" style="display:none;" id="error"></span>
- </div>
- <div style="height: 40px; width: 100%;border:1px solid transparent;margin-top: 5px;">
- <label class="label" for="userName">账号</label>
- <input type="text" id="userName" name="user.name" class="text" autocomplete="off" tabindex="1">
- </div>
- <div style="height: 40px; width: 100%;border:1px solid transparent;margin-top: 5px;">
- <label style="position: absolute; margin-left:38px; height:40px;line-height:40px; color: #999;font-size: 12px;" for="userPassword">密码</label>
- <input type="password" id="userPassword" name="user.password" class="text" style="width: 160px;border-right: 0px;" autocomplete="off" tabindex="1">
- <div id="pwd" onclick="getPWD()" style="cursor:pointer; float: right; text-align:center; margin-right:28px; width:69px;border-right:1px solid #b0b0b0;border-top:1px solid #b0b0b0; border-bottom:1px solid #b0b0b0; height: 38px;line-height: 38px;color: #999;background-color: #fff;font-size: 12px;">获取密码</div>
- </div>
- <div style="height: 40px; width: 100%;border:1px solid transparent;margin-top: 5px;">
- <label class="label" for="yzm">验证码</label>
- <input type="text" id="yzm" name="yzm" style="width:50%" class="text" autocomplete="off" tabindex="1">
- <div id="jc" class="yzm" title="看不清?点击更换" onclick="this.style.backgroundImage='url(<%=basePath %>/userAction_checkCode?ts=' + new Date().getTime() + ')'"></div>
- </div>
- <div style="margin-top: 5px;">
- <input type="button" onclick="login()" class="login_btn" value="">
- </div>
- </form>
- </div>
- </div>
- </body>
- <script type="text/javascript">
- <!--
- $(function(){
- parent.$.messager.progress('close');
- });
- //-->
- </script>
- </html>
|