| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308 |
- <%@ page language="java" contentType="text/html; charset=UTF-8"
- pageEncoding="UTF-8" %>
- <%
- String path = request.getContextPath();
- String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
- String baseUrl = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + "/";
- %>
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <meta name="viewport"
- content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
- <link type="text/css" rel="stylesheet" href="<%=basePath+"res/extjs/resources/css/ext-all-access.css" %>"/>
- <link type="text/css" rel="sytlesheet" href="<%=basePath+"res/particles/css/style.css" %>">
- <link type="text/css" rel="stylesheet" href="index1.css">
- <script type="text/javascript" src="<%=basePath+"res/jquery/jquery-3.3.1.min.js" %>"></script>
- <script type="text/javascript" src="<%=basePath+"res/particles/particles.min.js" %>"></script>
- <script type="text/javascript" src="<%=basePath+"res/extjs/ext-all.js" %>"></script>
- <script type="text/javascript" src="<%=basePath+"js/md5.js" %>"></script>
- <script type="text/javascript" src="<%=basePath+"js/denglu.js" %>"></script>
- <script type="text/javascript" src="<%=basePath+"res/extjs/locale/ext-lang-zh_CN.js" %>"></script>
- <title>智慧消防管理平台</title>
- </head>
- <body onload="webInit();" style="overflow:hidden;">
- <form id="my_login">
- <div id="particles-js">
- <div class="bdy-login">
- <div id="frm-login" autocomplete="off">
- <p>
- <img src="res/img/login_title.png" alt="">
- </p>
- <p>
- <span>用户名</span>
- <input type="text" placeholder="请输入用户名" id="username" name="username" autocomplete="off">
- </p>
- <p>
- <span>密 码</span>
- <input type="password" placeholder="请输入密码" id="password" name="password" autocomplete="off">
- </p>
- <p style="display:flex">
- <span>验证码</span>
- <input id="userCaptcha" name="userCaptcha" type="text" maxlength="4" class="inputs" placeholder="请输入验证码" autocomplete="off"/>
- <img id="kaptchaImage" src="./login/getCheckNumber" width="130" height="37" style="border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 5px; " onclick="change();">
- </p>
- <p id="btn-submit" onclick="loginSubmit()">
- 登 录
- </p>
- </div>
- </div>
- </div>
- </form>
- <script src="res/particles/js/app.js"></script>
- <script>
- $(function () {
- particlesJS.load('div-particles', 'https://iot.usky.cn/jdxf/Public/vendor/particles/assets/particles.json', function () {
- console.log('callback - particles.js config loaded')
- });
- $("#btn-submit").hover(function () {
- $(this).css({
- color: '#5cc7ff',
- border: '1px solid #5cc7ff',
- })
- });
- $("#btn-submit").mouseleave(function () {
- $(this).css({
- color: '#1EB2FF',
- border: '1px solid #009FFF',
- })
- });
- $("input").focus(function () {
- $(this).parent().css({
- border: '1px solid #009fff',
- })
- });
- $("input").blur(function () {
- $(this).parent().css({
- border: '1px solid #06538a',
- })
- })
- });
- $(function () {
- var w = $(document).width();
- var l = (w - 380) / 2;
- $("#btn-submit").click(function () {
- $("#frm-login").submit()
- });
- $(".bdy-login").css({
- "left": l
- }).animate({
- top: '300px',
- opacity: 1,
- filter: "alpha(opacity=" + 100 + ")"
- }, 1000);
- $(document).keydown(function (e) {
- if (e.which == 13) {
- $("#frm-login").submit()
- }
- })
- });
- var webInit = function () {
- sessionStorage.setItem('V_LOGINNAME', '');
- sessionStorage.setItem('V_PASSWORD', '');
- }
- var loginSubmit = function () {
- var code=document.getElementById("userCaptcha").value;
- if(window.localStorage.getItem('userCode')){
- var userCode = window.localStorage.getItem('userCode')
- if (userCode>=5){
- var userTime = window.localStorage.getItem('userTime')
- var nowTime1 = parseInt(new Date().getTime()/1000)
- var timeDiff1 = nowTime1-userTime
- var timeDiff = 10-timeDiff1
- if (timeDiff>0){
- window.alert("登录失败超过5次,请"+timeDiff+"秒后再重新登录!");
- }else {
- window.localStorage.setItem('userCode','0')
- window.localStorage.setItem('userTime',0)
- if(code=='') {
- Ext.Msg.show({
- title: '错误信息',
- msg: '请输入验证码!'
- });
- }else {
- var basePath = $("#basePath").val();
- var queryJson = new Object();
- queryJson.V_LOGINNAME = $("#username").val();
- queryJson.V_PASSWORD = md5($("#password").val());
- queryJson.V_COMMAND = "LOGIN";
- queryJson.code =code;
- var qdata = "queryJson=" + JSON.stringify(queryJson);
- var qurl = basePath + "login/tolgin"
- $.ajax({
- type: 'POST',
- url: qurl,
- data: qdata,
- success: function (result) {
- var json = eval('(' + result + ')');
- // alert('ceshi')
- sessionStorage.setItem('V_LOGINNAME',$("#username").val());
- sessionStorage.setItem('V_PASSWORD',$("#password").val());
- if (json.login == 'true') {
- if ($("#username").val() == "wjzn") {
- location.href = basePath + "view/frontpage/index.html"
- } else {
- // location.href = basePath + "index_QrCode.jsp";
- location.href = basePath + json.href
- }
- } else {
- if (json.login == 'false') {
- CheckNumber();
- Ext.Msg.show({
- title: '错误信息',
- msg: json.Msg === 'CODE WRONG' ? '验证码错误!'
- : json.Msg === 'WRONG PASSWORD!!!' ? '密码输入错误!'
- : json.Msg === 'LOGIN NAME WRONG' ? '用户名输入错误!'
- : json.Msg === 'WRONG TIME' ? '密码已超过90天未修改,请及时修改!'
- : json.Msg
- });
- if(window.localStorage.getItem('userCode')){
- var error_times = window.localStorage.getItem('userCode')
- error_times++;
- window.localStorage.setItem('userCode',error_times)
- if (error_times==5){
- var nowTime = parseInt(new Date().getTime()/1000)
- window.localStorage.setItem('userTime',nowTime)
- }
- }else {
- window.localStorage.setItem('userCode','1')
- }
- }
- }
- }
- });
- }
- }
- }else {
- if(code=='') {
- Ext.Msg.show({
- title: '错误信息',
- msg: '请输入验证码!'
- });
- }else {
- var basePath = $("#basePath").val();
- var queryJson = new Object();
- queryJson.V_LOGINNAME = $("#username").val();
- queryJson.V_PASSWORD = md5($("#password").val());
- queryJson.V_COMMAND = "LOGIN";
- queryJson.code =code;
- var qdata = "queryJson=" + JSON.stringify(queryJson);
- var qurl = basePath + "login/tolgin"
- $.ajax({
- type: 'POST',
- url: qurl,
- data: qdata,
- success: function (result) {
- var json = eval('(' + result + ')');
- // alert('ceshi')
- sessionStorage.setItem('V_LOGINNAME',$("#username").val());
- sessionStorage.setItem('V_PASSWORD',$("#password").val());
- if (json.login == 'true') {
- if ($("#username").val() == "wjzn") {
- location.href = basePath + "view/frontpage/index.html"
- } else {
- // location.href = basePath + "index_QrCode.jsp";
- location.href = basePath + json.href
- }
- } else {
- if (json.login == 'false') {
- CheckNumber();
- Ext.Msg.show({
- title: '错误信息',
- msg: json.Msg === 'CODE WRONG' ? '验证码错误!'
- : json.Msg === 'WRONG PASSWORD!!!' ? '密码输入错误!'
- : json.Msg === 'LOGIN NAME WRONG' ? '用户名输入错误!'
- : json.Msg === 'WRONG TIME' ? '密码已超过90天未修改,请及时修改!'
- : json.Msg
- });
- if(window.localStorage.getItem('userCode')){
- var error_times = window.localStorage.getItem('userCode')
- error_times++;
- window.localStorage.setItem('userCode',error_times)
- if (error_times==5){
- var nowTime = parseInt(new Date().getTime()/1000)
- window.localStorage.setItem('userTime',nowTime)
- }
- }else {
- window.localStorage.setItem('userCode','1')
- }
- }
- }
- }
- });
- }
- }
- }else {
- if(code=='') {
- Ext.Msg.show({
- title: '错误信息',
- msg: '请输入验证码!'
- });
- }else {
- var basePath = $("#basePath").val();
- var queryJson = new Object();
- queryJson.V_LOGINNAME = $("#username").val();
- queryJson.V_PASSWORD = md5($("#password").val());
- queryJson.V_COMMAND = "LOGIN";
- queryJson.code =code;
- var qdata = "queryJson=" + JSON.stringify(queryJson);
- var qurl = basePath + "login/tolgin"
- $.ajax({
- type: 'POST',
- url: qurl,
- data: qdata,
- success: function (result) {
- var json = eval('(' + result + ')');
- // alert('ceshi')
- sessionStorage.setItem('V_LOGINNAME',$("#username").val());
- sessionStorage.setItem('V_PASSWORD',$("#password").val());
- if (json.login == 'true') {
- if ($("#username").val() == "wjzn") {
- location.href = basePath + "view/frontpage/index.html"
- } else {
- // location.href = basePath + "index_QrCode.jsp";
- location.href = basePath + json.href
- }
- } else {
- if (json.login == 'false') {
- CheckNumber();
- Ext.Msg.show({
- title: '错误信息',
- msg: json.Msg === 'CODE WRONG' ? '验证码错误!'
- : json.Msg === 'WRONG PASSWORD!!!' ? '密码输入错误!'
- : json.Msg === 'LOGIN NAME WRONG' ? '用户名输入错误!'
- : json.Msg === 'WRONG TIME' ? '密码已超过90天未修改,请及时修改!'
- : json.Msg
- });
- if(window.localStorage.getItem('userCode')){
- var error_times = window.localStorage.getItem('userCode')
- error_times++;
- window.localStorage.setItem('userCode',error_times)
- if (error_times==5){
- var nowTime = parseInt(new Date().getTime()/1000)
- window.localStorage.setItem('userTime',nowTime)
- }
- }else {
- window.localStorage.setItem('userCode','1')
- }
- }
- }
- }
- });
- }
- }
- };
- // $("#my_login").submit(function (e) {
- // loginSubmit();
- // });
- function CheckNumber(){
- $('#userCaptcha').val('')
- $('#kaptchaImage').attr('src', './login/getCheckNumber?' + Math.floor(Math.random() * 100));
- }
- </script>
- <input type="hidden" id="basePath" name="basePath" value="<%=basePath %>"/>
- </body>
- </html>
|