From 8abbee975353926e51a426a75c67119337fbdae4 Mon Sep 17 00:00:00 2001
From: zhitong.yu <xynz17@163.com>
Date: 星期五, 27 十二月 2024 17:38:42 +0800
Subject: [PATCH] 通用版本V2.0 修复被检测漏洞
---
src/main/webapp/index.jsp | 553 +++++++++++++++++++++++++++++++++++++-----------------
1 files changed, 378 insertions(+), 175 deletions(-)
diff --git a/src/main/webapp/index.jsp b/src/main/webapp/index.jsp
index 9cb04f3..4a8b0cb 100644
--- a/src/main/webapp/index.jsp
+++ b/src/main/webapp/index.jsp
@@ -9,58 +9,167 @@
<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">鎺ㄨ崘鎮ㄤ娇鐢ㄨ胺姝宑horme娴忚鍣�<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">鎺ㄨ崘鎮ㄤ娇鐢ㄨ胺姝宑horme娴忚鍣�</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">鎺ㄨ崘鎮ㄤ娇鐢ㄨ胺姝宑horme娴忚鍣�</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;//鑾峰彇灞忓箷瀹介珮
@@ -128,173 +237,250 @@
</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{
- //鍒ゆ柇鐢ㄦ埛鍚嶅拰瀵嗙爜鏄惁姝g‘
- 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('鐧诲綍鎴愬姛!姝e湪璺宠浆澶у睆棣栭〉....')
- 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('鐧诲綍鎴愬姛!姝e湪璺宠浆澶у睆棣栭〉....')
- 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("楠岃瘉鐮佷笉姝g‘锛佽閲嶆柊杈撳叆")
- }
- }
- }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 瀵硅薄涓篢AC楠岃瘉鐮佺殑涓�浜涢厤缃拰楠岃瘉鐨勫洖璋�
+ 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" // 鏇挎崲鎴愯嚜瀹氫箟鐨刲ogo
+ }
+ // 鍙傛暟1 涓� tac鏂囦欢鏄洰褰曞湴鍧�锛� 鐩綍閲屽寘鍚� tac鐨刯s鍜宑ss绛夋枃浠�
+ // 鍙傛暟2 涓� tac楠岃瘉鐮佺浉鍏抽厤缃�
+ // 鍙傛暟3 涓� tac绐楀彛涓�浜涙牱寮忛厤缃�
+ window.initTAC("/hxzkuwb/view/tac", config, style).then(tac => {
+ tac.init(); // 璋冪敤init鍒欐樉绀洪獙璇佺爜
+ }).catch(e => {
+ console.log("鍒濆鍖杢ac澶辫触", 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 = "";
@@ -307,5 +493,22 @@
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>
--
Gitblit v1.10.0