login.html
9.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
<!doctype html>
<include file="public/layout" />
<meta name=”renderer” content=”webkit”>
<meta http-equiv=”X-UA-Compatible” content=”IE=Edge,chrome=1″ >
<head>
<meta charset="utf-8">
<title>登录页</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="shortcut icon" type="image/x-icon" href="__PUBLIC__/static/images/favicon.ico" media="screen"/>
<link rel="icon" href="__PUBLIC__/static/animated_favicon.gif" type="image/gif" />
<link href="__PUBLIC__/static/css/login.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="__PUBLIC__/static/js/jquery.js"></script>
<script type="text/javascript" src="__PUBLIC__/static/js/jquery.SuperSlide.2.1.2.js"></script>
<script type="text/javascript" src="__PUBLIC__/static/js/jquery.validation.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/static/js/jquery.cookie.js"></script>
<script>
function strkeydown(e, obj, str) {
if (document.documentElement) { e = e ? e : window.event; var keyCode = e.which ? e.which : e.keyCode;
if (keyCode == 13) { $(obj).blur(); document.getElementById(str).click(); }}}
</script>
<!--[if lte IE 8]>
<script type="Text/Javascript" language="JavaScript">
function detectBrowser()
{
var browser = navigator.appName
if(navigator.userAgent.indexOf("MSIE")>0){
var b_version = navigator.appVersion
var version = b_version.split(";");
var trim_Version = version[1].replace(/[ ]/g,"");
if ((browser=="Netscape"||browser=="Microsoft Internet Explorer"))
{
if(trim_Version == 'MSIE8.0' || trim_Version == 'MSIE7.0' || trim_Version == 'MSIE6.0'){
alert('请使用IE9.0版本以上进行访问');
return false;
}
}
}
}
detectBrowser();
</script>
<![endif]-->
<script type="text/javascript">
//若cookie值不存在,则跳出iframe框架
if(!$.cookie('tpshopActionParam') && $.cookie('admin_type') != 1){
$.cookie('admin_type','1' , {expires: 1 ,path:'/'});
//top.location.href = location.href;
}
</script>
</head>
<body>
<div class="login-layout">
<!--<div class="logo"><img src="__PUBLIC__/static/images/loginImg.png"></div>-->
<form action="" name='theForm' id="theForm" method="post">
<div class="login-form" style="position: relative">
<div class="formContent">
<div class="title">管理中心</div>
<div class="formInfo" >
<div class="formText">
<i class="icon icon-user"></i>
<input type="text" name="username" autocomplete="off" class="input-text" value="" placeholder="用户名" onkeydown="strkeydown(event, this, 'sumbbtn')"/>
</div>
<div class="formText">
<i class="icon icon-pwd"></i>
<input type="password" name="password" autocomplete="off" class="input-text" value="" placeholder="密 码" onkeydown="strkeydown(event, this, 'sumbbtn')" />
</div>
<div class="formText">
<i class="icon icon-chick"></i>
<input type="text" name="vertify" autocomplete="off" class="input-text chick_ue" value="" placeholder="验证码" onkeydown="strkeydown(event, this, 'sumbbtn')"/>
<img src="{:U('Landing/vertify')}" class="chicuele" id="imgVerify" alt="" onclick="fleshVerify()">
</div>
<div class="formText">
<div class="checkbox">
<div class="cur">
<input type="hidden" value="1" name="remember"/>
</div>
</div>
<span class="span">保存信息</span>
<!--<a href="{:U('Landing/forget_pwd')}" class="forget_pwd">忘记密码?</a>-->
</div>
<div class="formText submitDiv">
<span class="submit_span">
<input type="button" name="submit" class="sub" value="登录" id="sumbbtn">
</span>
</div>
</div>
</div>
<div id="error" style="position: absolute;left:0px;bottom: 12px;text-align: center;width:100%;">
</div>
</div>
</form>
</div>
<div id="bannerBox">
<ul id="slideBanner" class="slideBanner">
<li><img src="__PUBLIC__/static/images/banner_1.jpg"></li>
<li><img src="__PUBLIC__/static/images/banner_2.jpg"></li>
</ul>
</div>
<!--<script type="text/javascript" src="js/jquery.purebox.js"></script> -->
<script type="text/javascript">
$("#bannerBox").slide({mainCell:".slideBanner",effect:"fold",interTime:3500,delayTime:500,autoPlay:true,autoPage:true,endFun:function(i,c,s){
$(window).resize(function(){
var width = $(window).width();
var height = $(window).height();
s.find(".slideBanner,.slideBanner li").css({"width":width,"height":height});
});
}});
$(function(){
$(".formText .input-text").focus(function(){
$(this).parent().addClass("focus");
});
$(".formText .input-text").blur(function(){
$(this).parent().removeClass("focus");
});
$(".checkbox").click(function(){
if($(this).hasClass("checked")){
$(this).removeClass("checked");
$('input[name=remember]').val(0);
}else{
$(this).addClass("checked");
$('input[name=remember]').val(1);
}
});
$(".formText .input-yzm").focus(function(){
$(this).prev().show();
});
$(".formText").blur(function(){
$(this).prev().hide();
});
});
$(function(){
$('.submit_span .sub').on('click',function(){
$('.code').show();
});
$('#theForm input[name=submit]').on('click',function(){
var username=true;
var password=true;
var vertify=true;
if($('#theForm input[name=username]').val() == ''){
$('#error').html('<span class="error">用户名不能为空!</span>');
$('#theForm input[name=username]').focus();
username = false;
return false;
}
if($('#theForm input[name=password]').val() == ''){
$('#error').html('<span class="error">密码不能为空!</span>');
$('#theForm input[name=password]').focus();
password = false;
return false;
}
if($('#theForm input[name=vertify]').val() == ''){
$('#error').html('<span class="error">验证码不能为空!</span>');
$('#theForm input[name=vertify]').focus();
vertify = false;
return false;
}
if(vertify && $('#theForm input[name=username]').val() != '' && $('#theForm input[name=password]').val() != ''){
layer.msg('加载中...', {icon: 16,shade: [0.5, '#f5f5f5'],scrollbar: false,offset: '10px', time:100000}) ;
$.ajax({
async:false,
url:'/index.php?m=manager&c=Landing&a=login&t='+Math.random(),
data:{'username':$('#theForm input[name=username]').val(),'password':$('#theForm input[name=password]').val(),vertify:$('#theForm input[name=vertify]').val()},
type:'post',
dataType:'json',
success:function(res){
//console.log(res);
if(res.status != 1){
layer.closeAll();
$('#error').html('<span class="error">'+res.msg+'!</span>');
fleshVerify();
username=false;
password=false;
return false;
}else{
layer.closeAll();
top.location.href = res.url;
}
},
error : function(XMLHttpRequest, textStatus, errorThrown) {
layer.closeAll();
$('#error').html('<span class="error">网络失败,请刷新页面后重试!</span>');
}
});
}else{
return false;
}
});
$(document).click(function(e){
if(e.target.name !='vertify' && !$(e.target).parents("div").is(".submitDiv")){
$('.code').hide();
}
});
});
function fleshVerify(){
$('#imgVerify').attr('src','/index.php?m=manager&c=Landing&a=vertify&r='+Math.floor(Math.random()*100));//重载验证码
}
</script>
</body>
</html>