    <footer class="footer">
      <p>Copyright © <span id="currnetYear"></span> <a href="index.php">研易宝</a> All Rights Reserved</p>
    </footer>
	</article>

  <!-- 全屏loading -->
  <div class="loading-group" id="loading-group"><div class="loading"><span>加载中...</span></div></div>
    
  <!-- 用户登录 -->
	<div class="modal fade modal-login" id="modalLogin" tabindex="-1" role="dialog">
		<form class="modal-dialog validate-form" role="document" method="post" autocomplete="off">
			<div class="modal-content">
				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
				<div class="modal-body">
					<div class="logo"><img src="image/logo_blue.png" alt="研易宝" title="研易宝"></div>
					<h4 class="modal-title text-theme">用户登录</h4>
					<div class="login-group">
						<label class="control-label">账号:</label>
						<input class="form-control" id="userNameModal" name="userNameModal" value="" type="text" maxlength="150" placeholder="请输入账号">
						<div class="clearfix"></div>
						<label class="control-label">密码:</label>
						<input class="form-control" id="passWordModal" name="passWordModal" value="" type="password" maxlength="30" placeholder="请输入登录密码">
						<div class="checkcode-box dis-none">
							<label class="control-label">验证码:</label>
							<div class="form-group">
								<div class="col-md-5">
									<input class="form-control pl5 pr5 check-code" id="checkCodeModal" name="checkCodeModal" value="" type="text" maxlength="4">
								</div>
								<div class="col-md-7">
									<img src="image/tempcode.png" alt="验证码" id="imgCheckCodeModal" class="checkcode" onclick="">
									<button type="button" class="btn btn-link btn-sm underline pl5 pr0 pull-left" onclick="">换一张</button>
								</div>
							</div>
						</div>
						
						<div class="checkbox"><label><input type="checkbox" name="remeberMe" id="remeberMe">记住我</label></div>
						<button type="button" class="btn btn-theme btn-block mt15 btn-confirm">提交</button>
						<a href="register.php" class="btn btn-default mt10 fsize14 btn-block">没有账户？点此注册</a>
						<a href="forgetPS.php" class="btn btn-link mt10 btn-block fsize14  underline" target="_blank">忘记密码？</a>
					</div>
				</div>
				
			</div>
		</form>
	</div>


	<script type="text/javascript" src="js/jquery.min.js"></script>
	<script type="text/javascript" src="js/bootstrap/js/bootstrap.min.js"></script>
	<script type="text/javascript" src="js/jquery.gritter.min.js"></script>
	<script type="text/javascript" src="js/jquery.bootbox.min.js"></script>
  <script type="text/javascript" src="js/magnific/js/jquery.magnific-popup.min.js"></script>
  <script type="text/javascript" src="js/general.js"></script>
  <script type="text/javascript">

	$(function(){
		//==========================用户登录=============================
		$("#modalLogin").on("hidden.bs.modal", function (){
			var form = $(this).children("form").get(0);
			form.reset();
			$("#modalLogin label.error, #modalLogin .codecheck-result").remove();
			$("#modalLogin .error").removeClass("error");
			parseInt(getCookieValue("loginErrorCount")) >=3 ? $("#modalLogin .checkcode-box").removeClass("dis-none") : $("#modalLogin .checkcode-box").addClass("dis-none");
			$("#modalLogin .btn-confirm").removeClass("disabled").text("提交");
		});
		
		
		$("#modalLogin .btn-confirm").on("click",function(){
			var $this = $(this);
			var userName = $.trim($("#userNameModal").val());
			var passWord =  $.trim($("#passWordModal").val());
			var checkCode = $.trim($("#checkCodeModal").val());
			var flag = true;
			var remeberMe = false, expires = 0;
			if($("#remeberMe").is(":checked")){
				remeberMe = true;
				expires = 240;
			}
			
			$("#modalLogin label.error").remove();
			$("#modalLogin .error").removeClass("error");
			
			if(!userName){
				$("#userNameModal").addClass("error").after('<label class="error" for="userNameModal">账号不得为空</label>');
				flag = false;
			}
			
			//验证密码
			if(!passWord){
				$("#passWordModal").addClass("error").after('<label class="error" for="passWordModal">密码不得为空</label>');
				flag = false;
			}
			
			
			if(flag){
				var submitData = {
					loginUsername:userName,
					loginPassword:$.md5(passWord),
					code:checkCode,
					rememberUser:remeberMe
				}
				$.ajax({
					type: "GET",
					url: "mod=vmain.checkLogin",
					data: submitData,
					dataType: "json",
					beforeSend: function(){
						$this.addClass("disabled").text("账号验证中...");
					},
					success: function(data){
						setTimeout(function(){$this.removeClass("disabled").text("提交")},500);
						if(data.success){
							//关闭窗口
							$("#modalLogin").modal("hide");
							$.gritter.add({
								class_name:"gritter-success",
								title: "登录成功",
								time: 1500,
								sticky: false
							});
						}else{
							//登录失败
							$.gritter.add({
								class_name:"gritter-error",
								title: data.msg,
								time: 2000,
								sticky: false
							});
						}
			    	},
			    	error: function(){
			    		//登录失败
						$.gritter.add({
							class_name:"gritter-error",
							title: "验证提交失败，请稍后重试",
							time: 2000,
							sticky: false
						});
			       		setTimeout(function(){$this.removeClass("disabled").text("提交")},500);
			    	}
			    });
			}
			
			
		});
		$("#passWordModal, #checkCodeModal").on("keypress",function(e){
			var key = e.which;
			if(key == 13){
				$("#modalLogin .btn-confirm").click();
			}
		});


    //角色菜单切换
    checkUserMenu();
    $("input[name='userType']").on("click",function(e){
			 checkUserMenu();
		});
	});
  var checkUserMenu = function(){
    var userType = $("input[name='userType']:checked").val();
  
    if($("#leftmenu").length){
       $("#leftmenu li[data-type]").hide();
      let targetLi = $("#leftmenu li[data-type='" + userType + "']");
      if(targetLi.length) targetLi.show();
    }
  }
  </script>
</body>
</html>