<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="/Public/h-ui_v2.3/lib/html5.js"></script>
<script type="text/javascript" src="/Public/h-ui_v2.3/lib/respond.min.js"></script>
<script type="text/javascript" src="/Public/h-ui_v2.3/lib/PIE_IE678.js"></script>
<![endif]-->
<link href="/Public/h-ui_v2.3/css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="/Public/h-ui_v2.3/css/H-ui.login.css" rel="stylesheet" type="text/css" />
<link href="/Public/h-ui_v2.3/css/style.css" rel="stylesheet" type="text/css" />
<link href="/Public/h-ui_v2.3/lib/Hui-iconfont/1.0.6/iconfont.css" rel="stylesheet" type="text/css" />
<!--[if IE 6]>
<script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>Login</title>
</head>
<body>
<input type="hidden" id="TenantId" name="TenantId" value="" />
<div class="loginWraper">
  <div id="loginform" class="loginBox">
    <form class="form login-form form-horizontal" action="<?php echo U('login');?>" method="post">
      <div class="row cl">
        <label class="form-label col-3"><i class="Hui-iconfont">&#xe60d;</i></label>
        <div class="formControls col-8">
          <input id="username" name="username" type="text" placeholder="Account" class="input-text size-L">
        </div>
      </div>
      <div class="row cl">
        <label class="form-label col-3"><i class="Hui-iconfont">&#xe60e;</i></label>
        <div class="formControls col-8">
          <input id="password" name="password" type="password" placeholder="Password" class="input-text size-L">
        </div>
      </div>
      <div class="row cl">
        <div class="formControls col-8 col-offset-3">
          <input id="verify" name="verify" type="text" placeholder="Code" class="input-text size-L" value="" style="width:150px;">
          <img src="<?php echo U('Public/verify');?>" class="verifyimg reloadverify" title="Click refresh" width="90" height="40"> </div>
      </div>
      <div class="row">
        <div class="formControls col-8 col-offset-3">
          <input name="" type="submit" class="btn btn-success radius size-L" value="&nbsp;Login&nbsp;">
        </div>
      </div>
    </form>
  </div>
</div>
<script type="text/javascript" src="/Public/h-ui_v2.3/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="/Public/h-ui_v2.3/js/H-ui.js"></script>
<script type="text/javascript" src="/Public/h-ui_v2.3/lib/layer/2.1/layer.js"></script>
<script>
	$(function(){
		//刷新验证码
		var verifyimg = $(".verifyimg").attr("src");
	    $(".reloadverify").click(function(){
	    	if( verifyimg.indexOf('?')>0){
	            $(".verifyimg").attr("src", verifyimg+'&random='+Math.random());
	        }else{
	            $(".verifyimg").attr("src", verifyimg.replace(/\?.*$/,'')+'?'+Math.random());
	        }
	    });
    });

	$("form").submit(function(){
		var self = $(this);
		$.post(self.attr("action"), self.serialize(), success, "json");
		return false;

		function success(data){
			if(data.status){
				window.location.href = data.url;
			} else {
				layer.msg(data.info, {
					icon : 2,
					time : 1500
				});
				//刷新验证码
				$(".reloadverify").click();
			}
		}
	});
</script>
</body>
</html>