📄 正在查看:admin/view/default/index_login.htm
1<!doctype html>
2<html>
3<head>
4<title>通王CMS 后台登录</title>
5<meta http-equiv="content-type" content="text/html;charset=utf-8" />
6<script type="text/javascript">if(self.parent.frames.length != 0) self.parent.location=document.location;</script>
7<link href="{$C[admin_static]}admin/css/login.css" type="text/css" rel="stylesheet" />
8</head>
9
10<body>
11<form method="post" action="index.php?u=index-login">
12<input type="hidden" name="FORM_HASH" value="{$C[FORM_HASH]}" />
13<dl id="lgn">
14 <dt><a href="../" title="返回首页"></a></dt>
15 <dd><label>帐号</label><input type="text" name="username" class="int" /></dd>
16 <dd><label>密码</label><input type="password" name="password" class="int" /></dd>
17 <dt><input type="submit" value="登录" id="btn" /></dt>
18</dl>
19</form>
20<script src="{$C[admin_static]}js/jquery.js" type="text/javascript"></script>
21<script type="text/javascript">
22var t = ($(document).height()-$("#lgn").height())/2;
23$("#lgn").animate({top: t+10}, 'slow').animate({top: t-10}, 'fast').animate({top: t}, 'fast');
24$(window).resize(function(){
25 $("#lgn").offset({top: ($(document).height()-$("#lgn").height())/2});
26});
27$("label").click(function(){
28 $(this).parent().children(".int").focus();
29 $(this).hide();
30});
31$(".int").focusin(function() {
32 $(this).parent().children("label").hide();
33 $(this).parent().children("div").remove();
34}).focusout(function(){
35 if($(this).val().length==0) $(this).parent().children("label").show();
36});
37$("form:first").submit(function(){
38 $("#btn").attr("disabled", "disabled").addClass("on").val("登录中...");
39 setTimeout(function() { $("#btn").removeAttr("disabled").removeAttr("class").val("登录"); }, 2000);
40
41 $.post($(this).attr("action"), $(this).serialize(), function(data){
42 data = toJson(data);
43 $(".tips").remove();
44 if(data.name != "") {
45 $("#lgn .int[name='"+data.name+"']").parent().append('<div class="tips"><i></i><b>'+data.message+"</b></div>");
46 tAn($(".tips"));
47 $(".tips").click(function(){
48 tAn($(this));
49 });
50 }else location.href="./";
51 });
52 return false;
53});
54function toJson(data) {
55 var json = {};
56 try{
57 json = eval("("+data+")");
58 }catch(e){
59 //alert(data);
60 $("body").replaceWith(data);
61 }
62 return json;
63}
64function tAn(obj) {
65 obj.animate({left: 270}, 150).animate({left: 260}, 150).animate({left: 270}, 150).animate({left: 260}, 150).animate({left: 270}, 150).animate({left: 260}, 150).animate({left: 270}, 150).animate({left: 260}, 150);
66}
67</script>
68</body>
69</html>
70