| | |
| | | <html> |
| | | <head> |
| | | <title>登录</title> |
| | | <link href="CSS/style.css" rel="stylesheet"> |
| | | <link href="/hxzkuwb/view/CSS/style.css" rel="stylesheet"> |
| | | <link href="/hxzkuwb/view/JS/css/tac.css" rel="stylesheet"> |
| | | <style> |
| | | .genggai:hover{ |
| | | color: red; |
| | | } |
| | | .form { |
| | | width: 290px; |
| | | height: 380px; |
| | | display: flex; |
| | | flex-direction: column; |
| | | border-radius: 15px; |
| | | background-color: white; |
| | | box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1); |
| | | transition: .4s ease-in-out; |
| | | } |
| | | |
| | | .form:hover { |
| | | box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.1); |
| | | scale: 0.99; |
| | | } |
| | | |
| | | .heading { |
| | | position: relative; |
| | | text-align: center; |
| | | color: black; |
| | | top: 3em; |
| | | font-weight: bold; |
| | | } |
| | | |
| | | .check { |
| | | position: relative; |
| | | align-self: center; |
| | | top: 4em; |
| | | } |
| | | |
| | | .input { |
| | | position: relative; |
| | | width: 2.5em; |
| | | height: 2.5em; |
| | | margin: 1em; |
| | | border-radius: 5px; |
| | | border: none; |
| | | outline: none; |
| | | background-color: rgb(235, 235, 235); |
| | | box-shadow: inset 3px 3px 6px #d1d1d1, |
| | | inset -3px -3px 6px #ffffff; |
| | | top: 6.5em; |
| | | left: 1.5em; |
| | | padding-left: 15px; |
| | | transition: .4s ease-in-out; |
| | | } |
| | | |
| | | .input:hover { |
| | | box-shadow: inset 0px 0px 0px #d1d1d1, |
| | | inset 0px 0px 0px #ffffff; |
| | | background-color: lightgrey; |
| | | } |
| | | |
| | | .input:focus { |
| | | box-shadow: inset 0px 0px 0px #d1d1d1, |
| | | inset 0px 0px 0px #ffffff; |
| | | background-color: lightgrey; |
| | | } |
| | | |
| | | .btn1 { |
| | | position: relative; |
| | | top: 8.5em; |
| | | left: 2.4em; |
| | | width: 17em; |
| | | height: 3em; |
| | | border-radius: 5px; |
| | | border: none; |
| | | outline: none; |
| | | transition: .4s ease-in-out; |
| | | box-shadow: 1px 1px 3px #b5b5b5, |
| | | -1px -1px 3px #ffffff; |
| | | } |
| | | |
| | | .btn1:active { |
| | | box-shadow: inset 3px 3px 6px #b5b5b5, |
| | | inset -3px -3px 6px #ffffff; |
| | | } |
| | | |
| | | .btn2 { |
| | | position: relative; |
| | | top: 9.5em; |
| | | left: 2.4em; |
| | | width: 17em; |
| | | height: 3em; |
| | | border-radius: 5px; |
| | | border: none; |
| | | outline: none; |
| | | transition: .4s ease-in-out; |
| | | box-shadow: 1px 1px 3px #b5b5b5, |
| | | -1px -1px 3px #ffffff; |
| | | } |
| | | |
| | | .btn2:active { |
| | | box-shadow: inset 3px 3px 6px #b5b5b5, |
| | | inset -3px -3px 6px #ffffff; |
| | | } |
| | | </style> |
| | | </head> |
| | | <body style="overflow:hidden;"> |
| | | |
| | | <div class="loginav"> |
| | | <div class="video" style="position: relative;"><video src="images/video.mp4" muted autoplay loop></div> |
| | | <div class="video" style="position: relative;"><video src="images/video.mp4" muted autoplay loop/></div> |
| | | <div class=""></div> |
| | | <div class="loginbox boxall" style="height: 400px;width: 450px;"> |
| | | <div class="loginbox boxall" style="width: 450px;"> |
| | | <div class="logo"> |
| | | <h1>定位管理系统</h1> |
| | | <h1 id="title">定位管理系统</h1> |
| | | <!-- <img src="images/logo.png"> --> |
| | | </div> |
| | | <a href="javascript:;" class="yonghulog" onclick="yonghu()"><div class="logintit yh" style="display: inline-block">用户登录</div></a><a class="duanxinlog" href="javascript:;" onclick="duanxin()" ><div class="logintit dx" style="display: inline-block;margin-left: 30px">短信登录</div></a> |
| | | <ul class="logininput" id="yong"> |
| | | <a href="javascript:;" class="yonghulog" onclick="yonghu()"><div class="logintit yh" style="display: inline-block">用户登录</div></a><a class="duanxinlog" href="javascript:;" style="margin-left: 5%" onclick="duanxin()"><div class="logintit dx" style="display: inline-block;margin-left: 30px">短信登录</div></a> |
| | | <form id="marsMapForm" action="/hxzkuwb/Mars3dMap" method="post"> |
| | | <ul class="logininput" id="yong" style=""> |
| | | <li> |
| | | <i><img src="/hxzkuwb/view/images/user.png"></i> |
| | | <input class="forminput" value="" id="yhm" required type="text" placeholder="用户名"> |
| | | </li> |
| | | <li> |
| | | <i><img src="/hxzkuwb/view/images/password.png"></i> |
| | | <input class="forminput" type="password" id="pass" required value="" placeholder="密码"> |
| | | </li> |
| | | <div id="captcha-box"></div> |
| | | <li id="denglu"> |
| | | <button type="submit" id="LoginDengLu" style="cursor:pointer;;border: none;width: 100%" class="btn btnblock btn-lg btn-block btn-primary">登录</button> |
| | | </li> |
| | | <%-- <li style="color: white;text-align: center;position: relative;left: 5%" id="title2">推荐您使用谷歌chorme浏览器<a class="genggai" href="./NotPassWord.jsp" style="color: #ccc;font-size: 13px;position: relative;left: 10%">更改密码</a></li>--%> |
| | | </ul> |
| | | </form> |
| | | <form id="marsMapFormSMS" action="/hxzkuwb/Mars3dMap" method="post"> |
| | | <ul class="logininput" style="display: none;" id="duan"> |
| | | <li> |
| | | <i><img src="images/user.png"></i> |
| | | <input class="forminput" value="" id="yhm" required type="text" placeholder="用户名"> |
| | | <i><img src="/hxzkuwb/view/images/user.png"></i> |
| | | <input class="forminput" value="" id="yhm1" type="text" placeholder="请输入手机号"> |
| | | </li> |
| | | <li> |
| | | <i><img src="images/password.png"></i> |
| | | <input class="forminput" type="password" id="pass" required value="" placeholder="密码"> |
| | | </li> |
| | | <li> |
| | | <a href="javascript:;" onclick="login()" class="btn btnblock btn-lg btn-block btn-primary">登录</a> |
| | | </li> |
| | | <li style="color: white;text-align: center">推荐您使用谷歌chorme浏览器</li> |
| | | </ul> |
| | | <ul class="logininput" style="position: relative;top: -293px;display: none" id="duan"> |
| | | <li> |
| | | <i><img src="images/user.png"></i> |
| | | <input class="forminput" value="" id="yhm1" type="text" placeholder="请输入手机号"> |
| | | </li> |
| | | <li> |
| | | <i><img src="images/password.png"></i> |
| | | <i><img src="/hxzkuwb/view/images/password.png"></i> |
| | | <input class="forminput" type="password" id="pass1" value="" placeholder="请输入验证码"> |
| | | </li> |
| | | <li> |
| | | <a href="javascript:;" onclick="login()" style="text-align: center;" class="btn btnblock btn-lg btn-block btn-primary">登录</a> |
| | | <button href="javascript:;" id="LoginDengLu1" style="border: none;cursor: pointer;width: 100%;text-align: center;" class="btn btnblock btn-lg btn-block btn-primary">登录</button> |
| | | </li> |
| | | <li> |
| | | <a href="javascript:;" id="yzm" style="width: 100px;height: 40px;font-size: 12px;line-height: 40px;float: right;position: relative;top: -154px;margin-right: 5px" class="btn btnblock btn-lg btn-block btn-primary" onclick="hqyzm()">获取验证码</a> |
| | | <a type="submit" href="javascript:;" id="yzm" style="width: 100px;height: 40px;font-size: 12px;line-height: 40px;float: right;position: relative;top: -154px;margin-right: 5px" class="btn btnblock btn-lg btn-block btn-primary" onclick="hqyzm()">获取验证码</a> |
| | | </li> |
| | | <li style="color: white;text-align: center;position: relative;top: -30px;left: 52px">推荐您使用谷歌chorme浏览器</li> |
| | | |
| | | </ul> |
| | | </form> |
| | | <div class="boxfoot"></div> |
| | | </div> |
| | | </div> |
| | | <div style="width: 100%;position: fixed;top: 32%;left: 40%"> |
| | | </div> |
| | | |
| | | <canvas id='canvas' |
| | | style="position:fixed; width:100%; height:100%; left: 0; top: 0; opacity: .3; pointer-events: none;"></canvas> |
| | | |
| | | <script src="JS/translate.js"></script> |
| | | <script> |
| | | |
| | | var canvas = document.querySelector('canvas'); |
| | | var ctx = canvas.getContext('2d'); |
| | | var w = window.innerWidth;//获取屏幕宽高 |
| | |
| | | |
| | | </script> |
| | | </body> |
| | | <script src="/hxzkuwb/JS/layui.js"></script> |
| | | <script src="/hxzkuwb/JS/layer.js"></script> |
| | | <script src="HouTai/Js/jquery-3.5.1.js"></script> |
| | | <script src="/hxzkuwb/view/JS/layui.js"></script> |
| | | <script src="/hxzkuwb/view/JS/layer.js"></script> |
| | | <script src="/hxzkuwb/HouTai/Js/jquery-3.5.1.js"></script> |
| | | <script src="/hxzkuwb/view/JS/huakuai.js"></script> |
| | | <script src="/hxzkuwb/view/JS/tac.min.js"></script> |
| | | <script src="/hxzkuwb/view/tac/js/notify_stand.js"></script> |
| | | <script src="/hxzkuwb/view/tac/js/notify.js"></script> |
| | | <script> |
| | | var yzms = ""; |
| | | var LoginNum = 0; |
| | | function login(){ |
| | | var opacityValue = $("#yong").css("opacity"); |
| | | if(opacityValue == 1){ |
| | | var yhm = $("#yhm").val(); |
| | | var pass = $("#pass").val(); |
| | | if(yhm == "" || yhm == null ){ |
| | | layer.msg('请先输入用户名和密码后在登录') |
| | | }else{ |
| | | if(pass == "" || pass == null){ |
| | | layer.msg('请先输入密码后在登录') |
| | | }else{ |
| | | if (localStorage.getItem("loginNum") >= 3){ |
| | | layer.msg('由于您输入密码错误大于3次为了安全您需要用短信验证登录...') |
| | | }else{ |
| | | //判断用户名和密码是否正确 |
| | | var data = "username="+yhm+"&password="+pass |
| | | $.post("/hxzkuwb/login",data,function (data){ |
| | | if(data == null || data == ""){ |
| | | layer.msg('当前输入的用户名密码不正确,请重新输入') |
| | | LoginNum = LoginNum+1; |
| | | localStorage.setItem("loginNum",LoginNum) |
| | | }else{ |
| | | layer.msg('登录成功!正在跳转大屏首页....') |
| | | localStorage.setItem("loginNum",0) |
| | | sessionStorage.setItem("username",data.username) |
| | | localStorage.setItem("username",data.username) |
| | | $.ajax({ |
| | | url: '/hxzkuwb/addLoginLog', |
| | | type: 'GET', |
| | | async: false, |
| | | data: { |
| | | name:yhm, |
| | | loginfs:"账号密码登录" |
| | | }, |
| | | success: function(data) { |
| | | console.log(data); |
| | | }, |
| | | error: function(xhr, status, error) { |
| | | console.error(status + ': ' + error); |
| | | } |
| | | }); |
| | | setTimeout(function (){ |
| | | window.location='/hxzkuwb/Home/Home.jsp' |
| | | },500) |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | }else{ |
| | | var yhm = $("#yhm1").val(); |
| | | var pass = $("#pass1").val(); |
| | | if(yhm == "" || yhm == null ){ |
| | | layer.msg('请先输入手机号和验证码后在登录') |
| | | }else{ |
| | | if(yhm.length == 11){ |
| | | if(pass == "" || pass == null){ |
| | | layer.msg('请先输入验证码后在登录') |
| | | }else{ |
| | | //判断验证码和手机号是否正确; |
| | | var exits = $("#pass1").val(); |
| | | if(yzms == exits) { |
| | | var data = "phone="+yhm |
| | | $.post("/hxzkuwb/login",data,function (data){ |
| | | if (data.phone == yhm){ |
| | | localStorage.setItem("loginNum",0) |
| | | layer.msg('登录成功!正在跳转大屏首页....') |
| | | sessionStorage.setItem("username",data.username) |
| | | localStorage.setItem("username",data.username) |
| | | $.ajax({ |
| | | url: '/hxzkuwb/addLoginLog', |
| | | type: 'GET', |
| | | async: false, |
| | | data: { |
| | | name:data.username, |
| | | loginfs:"验证码登录" |
| | | }, |
| | | success: function(data) { |
| | | console.log(data); |
| | | }, |
| | | error: function(xhr, status, error) { |
| | | console.error(status + ': ' + error); |
| | | } |
| | | }); |
| | | setTimeout(function (){ |
| | | window.location='/hxzkuwb/Home/Home.jsp' |
| | | },500) |
| | | } |
| | | }) |
| | | }else{ |
| | | layer.msg("验证码不正确!请重新输入") |
| | | } |
| | | } |
| | | }else{ |
| | | layer.msg('请输入正确的11位手机号') |
| | | } |
| | | } |
| | | } |
| | | } |
| | | $(".yh").css("text-decoration","underline") |
| | | |
| | | var LoginId = ""; |
| | | var loginTimer = null; // 用于存储计时器的变量 |
| | | var sessionId; |
| | | var loginAttempts; // 用于记录连续登录失败的次数 |
| | | window.onload = function() { |
| | | if (loginAttempts !== undefined && loginAttempts !== null) { |
| | | document.cookie = "loginAttempts=" + loginAttempts + ";Path=/hxzkuwb;Max-Age=3600"; |
| | | } else { |
| | | loginAttempts = 0; |
| | | console.error("loginAttempts is 0"); |
| | | } |
| | | }; |
| | | const form = document.getElementById('marsMapForm'); |
| | | form.addEventListener('submit', function(event) { |
| | | // 阻止表单的默认提交行为 |
| | | event.preventDefault(); |
| | | |
| | | if (loginAttempts >= 3) { |
| | | notify.error("您已连续登录失败3次,请1分钟后再次尝试"); |
| | | return; |
| | | } |
| | | if (LoginId == "") { |
| | | //没有验证过 |
| | | $("#denglu").hide() |
| | | // config 对象为TAC验证码的一些配置和验证的回调 |
| | | const config = { |
| | | requestCaptchaDataUrl: "/hxzkuwb/code", validCaptchaUrl: "/hxzkuwb/checkCode", |
| | | bindEl: "#captcha-box", |
| | | validSuccess: (res, c, tac) => { |
| | | // 销毁验证码服务 |
| | | tac.destroyWindow(); |
| | | console.log("验证成功,后端返回的数据为", res); |
| | | LoginId = res.data.id |
| | | $("#denglu").show() |
| | | // 启动1分钟的计时器 |
| | | loginTimer = setTimeout(() => { |
| | | notify.error("1分钟内未登录,重新验证"); |
| | | LoginId = ""; |
| | | login(); // 重新调用login函数进行验证 |
| | | }, 60000); // 60000毫秒 = 1分钟 |
| | | }, |
| | | // 验证失败的回调函数(可忽略,如果不自定义 validFail 方法时,会使用默认的) |
| | | validFail: (res, c, tac) => { |
| | | console.log("验证码验证失败回调...") |
| | | LoginId = "" |
| | | // 验证失败后重新拉取验证码 |
| | | tac.reloadCaptcha(); |
| | | }, |
| | | // 刷新按钮回调事件 |
| | | btnRefreshFun: (el, tac) => { |
| | | console.log("刷新按钮触发事件...") |
| | | LoginId = "" |
| | | tac.reloadCaptcha(); |
| | | }, |
| | | // 关闭按钮回调事件 |
| | | btnCloseFun: (el, tac) => { |
| | | console.log("关闭按钮触发事件...") |
| | | LoginId = "" |
| | | tac.destroyWindow(); |
| | | $("#denglu").show() |
| | | } |
| | | } |
| | | // 一些样式配置, 可不传 |
| | | let style = { |
| | | logoUrl: null// 去除logo |
| | | // logoUrl: "/xx/xx/xxx.png" // 替换成自定义的logo |
| | | } |
| | | // 参数1 为 tac文件是目录地址, 目录里包含 tac的js和css等文件 |
| | | // 参数2 为 tac验证码相关配置 |
| | | // 参数3 为 tac窗口一些样式配置 |
| | | window.initTAC("/hxzkuwb/view/tac", config, style).then(tac => { |
| | | tac.init(); // 调用init则显示验证码 |
| | | }).catch(e => { |
| | | console.log("初始化tac失败", e); |
| | | }) |
| | | } else { |
| | | //验证过 |
| | | //二次验证 |
| | | if (LoginId == "") { |
| | | login() |
| | | } else { |
| | | clearTimeout(loginTimer); |
| | | const username = $("#yhm").val(); |
| | | const password = $("#pass").val(); |
| | | var data = { |
| | | username, |
| | | password |
| | | } |
| | | $.ajax({ |
| | | url: "/hxzkuwb/login", |
| | | type: "POST", |
| | | async: true, // 设置为同步请求 |
| | | data: data, |
| | | success: function (response) { |
| | | if (response == "0") { |
| | | notify.error('当前登录用户不存在,请重新输入') |
| | | LoginId = "" |
| | | loginAttempts++; // 增加登录失败次数 |
| | | if (loginAttempts >= 3) { |
| | | document.cookie = "loginAttempts=" + loginAttempts + ";Path=/hxzkuwb;Max-Age=3600"; |
| | | loginTimer = setTimeout(() => { |
| | | loginAttempts = 0; // 重置登录失败次数 |
| | | document.cookie = "loginAttempts=" + loginAttempts + ";Path=/hxzkuwb;Max-Age=3600"; |
| | | notify.success("可以再次尝试登录"); |
| | | }, 60000); // 60000毫秒 = 1分钟 |
| | | } |
| | | } else { |
| | | loginAttempts = 0; // 重置登录失败次数 |
| | | document.cookie = "loginAttempts=" + loginAttempts + ";Path=/hxzkuwb;Max-Age=3600"; |
| | | const username1 = $("#yhm").val(); |
| | | notify.success("登录成功") |
| | | sessionId = response; |
| | | localStorage.setItem("hxzkmars3d", response) |
| | | sessionStorage.setItem("username", username1) |
| | | form.submit(); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | const form1 = document.getElementById('marsMapFormSMS'); |
| | | form1.addEventListener('submit', function(event) { |
| | | // 阻止表单的默认提交行为 |
| | | event.preventDefault(); |
| | | if (hqyzmnum == 0){ |
| | | notify.error("请先获取验证码") |
| | | }else{ |
| | | var yhm = $("#yhm1").val(); |
| | | var data ="phone="+yhm |
| | | var usernames; |
| | | $.get("/hxzkuwb/findPhoneUser",data,function (data){ |
| | | usernames = data.username |
| | | if (data == "" || data.length == 0){ |
| | | notify.error("当前手机号不存在,请重新输入") |
| | | }else{ |
| | | var pass = $("#pass1").val(); |
| | | var data = "phone="+yhm |
| | | if (pass == yzms){ |
| | | $.ajax({ |
| | | url: "/hxzkuwb/login", |
| | | type: "POST", |
| | | async: true, // 设置为同步请求 |
| | | data: data, |
| | | success: function (response) { |
| | | if (response == "0") { |
| | | notify.error('登录有误,请重新登录!') |
| | | } else { |
| | | notify.success("登录成功") |
| | | loginAttempts = 0; // 重置登录失败次数 |
| | | document.cookie = "loginAttempts=" + loginAttempts + ";Path=/hxzkuwb;Max-Age=3600"; |
| | | sessionId = usernames; |
| | | localStorage.setItem("hxzkmars3d", response) |
| | | sessionStorage.setItem("username", usernames) |
| | | form.submit(); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | }else{ |
| | | notify.error("验证码有误请重新获取") |
| | | } |
| | | } |
| | | |
| | | }) |
| | | } |
| | | |
| | | }); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | function duanxin(){ |
| | | $("#yong").animate({opacity: 0}, 1000); |
| | | // 使用 jQuery 设置 ID 为 "loginbox" 的元素高度为 200px |
| | | $("#duan").fadeIn(1000) |
| | | $("#marsMapForm").hide(); |
| | | $(".loginbox").height("330px") |
| | | $(".dx").css("text-decoration","underline") |
| | | $(".yh").css("text-decoration","none") |
| | | $("#yhm1").val("") |
| | | $("#pass1").val("") |
| | | } |
| | | function yonghu(){ |
| | | $("#duan").fadeOut(1000) |
| | | $("#yong").animate({opacity: 1}, 1000); |
| | | $("#marsMapForm").fadeIn(500) |
| | | $("#duan").hide() |
| | | $(".yh").css("text-decoration","underline") |
| | | $(".dx").css("text-decoration","none") |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | var yzms; |
| | | var hqyzmnum = 0; |
| | | function hqyzm(){ |
| | | var phone = $("#yhm1").val(); |
| | | if(phone == "" || phone == null){ |
| | | layer.msg('请先输入手机号后在获取验证码') |
| | | notify.error("请填写手机号后在获取验证码") |
| | | }else{ |
| | | var data ="phone="+phone |
| | | $.get("/hxzkuwb/findPhoneUser",data,function (data){ |
| | | console.log(data) |
| | | if (data == "" || data.length == 0){ |
| | | layer.msg('当前手机号不存在,请重新输入后在获取') |
| | | }else{ |
| | | //发送验证码 |
| | | var yzm = generateRandomCode(); |
| | | var yzmpd = ""; |
| | | var data = "phone="+phone+"&randomNumber="+yzm; |
| | | $.ajax({ |
| | | url: "/hxzkuwb/sms", |
| | | data: data, |
| | | async: false, |
| | | success: function (data) { |
| | | // 处理返回的数据 |
| | | yzms = data; |
| | | $.get("/hxzkuwb/findPhoneUser",data,function (data){ |
| | | if (data == "" || data.length == 0){ |
| | | notify.error("当前手机号不存在,请重新输入") |
| | | }else{ |
| | | hqyzmnum++; |
| | | //发送验证码 |
| | | var yzm = generateRandomCode(); |
| | | var yzmpd = ""; |
| | | var data = "phone="+phone+"&randomNumber="+yzm; |
| | | $.ajax({ |
| | | url: "/hxzkuwb/sms", |
| | | data: data, |
| | | async: false, |
| | | success: function (data) { |
| | | // 处理返回的数据 |
| | | yzms = data; |
| | | |
| | | } |
| | | }); |
| | | startCountdown(60) |
| | | } |
| | | } |
| | | }); |
| | | startCountdown(60) |
| | | } |
| | | |
| | | }) |
| | | }) |
| | | |
| | | } |
| | | } |
| | | function startCountdown(seconds) { |
| | | var btn = document.getElementById('yzm'); |
| | | btn.disabled = true; |
| | | var count = seconds; |
| | | btn.textContent = count + ' 秒后重新获取'; |
| | | var timer = setInterval(function() { |
| | | count--; |
| | | if (count <= 0) { |
| | | clearInterval(timer); |
| | | btn.textContent = '获取验证码'; |
| | | btn.disabled = false; |
| | | } else { |
| | | btn.textContent = count + ' 秒后重新获取'; |
| | | } |
| | | }, 1000); |
| | | } |
| | | |
| | | |
| | | function generateRandomCode() { |
| | | var code = ""; |
| | |
| | | |
| | | return code; |
| | | } |
| | | |
| | | function startCountdown(seconds) { |
| | | var btn = document.getElementById('yzm'); |
| | | btn.disabled = true; |
| | | var count = seconds; |
| | | btn.textContent = count + "秒后重新获取"; |
| | | var timer = setInterval(function() { |
| | | count--; |
| | | if (count <= 0) { |
| | | clearInterval(timer); |
| | | btn.textContent = "获取验证码"; |
| | | btn.disabled = false; |
| | | } else { |
| | | btn.textContent = count + "秒后重新获取"; |
| | | } |
| | | }, 1000); |
| | | } |
| | | </script> |
| | | </html> |