<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta name="format-detection" content="telephone=no">
<meta http-equiv="x-rim-auto-match" content="none">
<link href="themes/xiaomi/css/merchant_login.css" rel="stylesheet" type="text/css" />
<script src="xxxx/jquery/jquery.1.11.1.min.js"></script>
<script src=""xxxx/decrypt.js"></script>
<script src="https://passport.cnblogs.com/scripts/jsencrypt.min.js"></script>
<title>商家登录</title>
<style>
#Form {
text-align: center;
}
.p0_1 {
width: 80%;
height: auto;
margin:0 auto;
margin-top: 50px;
}
.isCodeimg{
width: 38%;
height:30px;
margin-top: 20px;
margin-left: 0;
}
.button{
}
@media screen and (min-width: 950px) {
body {
text-align: center;
}
.content {
max-width: 640px;
margin: 0 auto;
}
}
</style>
</head>
<body>
<div class="content">
<form method="post" id="Form" autocomplete="off">
<img src="themes/xiaomi/images/dhm/p0_1.jpg" class="p0_1">
<input type="text" name="username" class="username" placeholder="账号"/>
<input type="password" name="password" class="password" placeholder="密码" autocomplete="off"/>
<input type="text" name="code" class="username" placeholder="验证码" style="margin-top:0;border-top:1px solid #f2f2f2;" id="is_yzm_new"/>
<img id="is_yzm" src="{:url("wangdian/yzm")}" class="isCodeimg" onclick='this.src=this.src+"&"+Math.random()'>
<input type="button" id="button" class="login" value="登录" style="-webkit-appearance: none;" />
</form>
</div>
<div style="display:none"><script type="text/javascript">var cnzz_protocol = (("https:" == document.location.protocol) ? " https://" : " http://");document.write(unescape("%3Cspan id='cnzz_stat_icon_1261630839'%3E%3C/span%3E%3Cscript src='" + cnzz_protocol + "s4.cnzz.com/z_stat.php%3Fid%3D1261630839'type='text/javascript'%3E%3C/script%3E"));</script></div>
</body>
<script type="text/javascript">
// $(document).ready(function () {
// };
$("#button").click(function(){
var name = document.forms['Form'].elements['username'].value;
var pwd = document.forms['Form'].elements['password'].value;
var isCode = document.forms['Form'].elements['code'].value;
var isVal = is_decrypt({'name':name,'pwd':pwd,'captcha':isCode,'encrypt':'yes'});//数据加密
if(isCode == "" || isCode == undefined){
alert('验证码不能为空');
}else if(/[A-Za-z0-9]+$/.test(name)){//账号验证
if(/^\\w+$/.test(pwd)||/[A-Za-z0-9]+$/.test(pwd)){//密码验证
$.ajax({
url:'{:url("wangdian/login")}',
type:'POST',
data:{'data':isVal},
dataType:'json',
success:function(data){
if(data == 0){
alert('用户名或密码不正确');
document.getElementById('is_yzm').src="{:url("wangdian/yzm")}"+"&"+ Math.random();
document.getElementById('is_yzm_new').value= "";
}else if(data == 2){
alert('验证码不正确');
document.getElementById('is_yzm').src="{:url("wangdian/yzm")}"+"&"+ Math.random();
document.getElementById('is_yzm_new').value= "";
}else if(data == 1){
location.href = "{:url('wangdian/dlcg')}";
}
}
})
}
}
});
</script>
<div style="display:none"><script type="text/javascript">var cnzz_protocol = (("https:" == document.location.protocol) ? " https://" : " http://");document.write(unescape("%3Cspan id='cnzz_stat_icon_1265112098'%3E%3C/span%3E%3Cscript src='" + cnzz_protocol + "s19.cnzz.com/z_stat.php%3Fid%3D1265112098' type='text/javascript'%3E%3C/script%3E"));</script></div>
</html>
js点击切换验证码图片
最新推荐文章于 2022-08-07 22:28:16 发布