123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233 |
- <%@ 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>
- <style type="">
- #code img {
- margin: 0 auto;
- padding-top: 24px;
- }
- </style>
- </head>
- <body 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 id="code" class="code" style="width: 100%;height: 230px;"></div>
- <span>
- <p>使用永天智慧云智慧消防公众号“扫一扫”完成登录</p>
- </span>
- <%-- <iframe src="QrCode.html" style="border: 0px;width: 100%;height: 230px;"></iframe>--%>
- </div>
- </div>
- </div>
- </form>
- <script src="res/particles/js/app.js"></script>
- <script src="res/jquery/jquery-3.3.1.min.js"></script>
- <script src="qrcode.min.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 uuid;
- const URL = document.location.protocol + "//" + window.location.host;
- function createUniqueString() {
- const timestamp = +new Date() + ''
- const randomNum = parseInt((1 + Math.random()) * 65536) + ''
- return (+(randomNum + timestamp)).toString(32)
- }
- function newCode(str) {
- var qrcode = new QRCode(document.getElementById("code"), {
- id: 'er_image',
- width: 200,
- height: 200
- });
- qrcode.makeCode(str);
- }
- var wsUri = "wss://qhome.usky.cn/wss/";
- var websocket = null;
- var initWebSocket = function () {
- try {
- websocket = new WebSocket(wsUri);
- websocket.onopen = function () {
- var json = {};
- json.actfrom = "loginpage";
- json.action = "query_ercode";
- websocket.send(JSON.stringify(json));
- setInterval(function () {
- if (websocket != null)
- websocket.send(JSON.stringify(json));
- }, 30000)
- };
- websocket.onmessage = function (evt) {
- console.log("Received:", evt.data);
- var jData = eval('(' + evt.data + ')');
- if (jData.action == "query_ercode") {
- document.getElementById("code").innerHTML = "";
- var evm_loing = jData.value;
- newCode("" + evm_loing);
- document.getElementById("code").title = '';
- } else if (jData.action == "loginphone") {
- var action = jData.action;
- var phonenumber = jData.phonenumber;
- // document.getElementById("action").value='';
- // document.getElementById("phonenumber").value='';
- // document.getElementById("action").value=action;
- // document.getElementById("phonenumber").value=phonenumber;
- sessionStorage.setItem('V_LOGINNAME', localStorage.getItem('V_LOGINNAME'));
- sessionStorage.setItem('V_PASSWORD', localStorage.getItem('V_PASSWORD'));
- setTimeout(() => {
- // location.href = URL + "/unnamed/view/mainframe.jsp"
- location.href = URL + "/YtIoT/view/mainframe.jsp"
- }, 1000)
- // var basePath = $("#basePath").val();
- // var queryJson = new Object();
- // queryJson.V_LOGINNAME = localStorage.getItem('V_LOGINNAME');
- // queryJson.V_PASSWORD = localStorage.getItem('V_PASSWORD');
- // 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')
- // if (json.login == 'true') {
- // sessionStorage.setItem('V_LOGINNAME', queryJson.V_LOGINNAME);
- // sessionStorage.setItem('V_PASSWORD', queryJson.V_PASSWORD);
- //
- // } else {
- // if (json.login == 'false') {
- // Ext.Msg.show({
- // title: '错误信息',
- // msg: json.Msg
- // });
- // }
- // }
- // }
- // });
- // alert("ceshi");
- websocket = null;
- }
- };
- websocket.onclose = function () {
- // 关闭 websocket
- console.log('连接已关闭...');
- // alert("连接已关闭...");
- };
- } catch (exception) {
- console.log("Exception:", exception);
- (function () {
- })()
- }
- }
- // $(document).ready(function(){
- // $("#login_ok").hide();
- initWebSocket();
- // });
- </script>
- <input type="hidden" id="basePath" name="basePath" value="<%=basePath %>"/>
- </body>
- </html>
|