<!DOCTYPE html>
|
<html lang="zh-cn">
|
|
<head>
|
<meta charset="utf-8">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<title>布心街后台管理系统</title>
|
<link href="css/bootstrap.min.css" rel="stylesheet">
|
<link href="css/main.css" rel="stylesheet">
|
<!--[if lt IE 9]>
|
<script src="js/html5shiv.js"></script>
|
<script src="js/respond.min.js"></script>
|
<![endif]-->
|
</head>
|
|
<body background="image/airlift-bg.png">
|
<h1>后台管理系统</h1>
|
<div class="shurukuang">
|
<h2>管理员登录</h2>
|
<div class="auth-form-body mt-3">
|
<form role="form" class="form-horizontal">
|
<label for="login_field">用户名</label>
|
<input autocapitalize="off" autocorrect="off" autofocus class="form-control input-block input-lg" id="account" name="account" tabindex="1" type="text" /></br>
|
<label for="password">密码</label>
|
<input class="form-control form-control input-block input-lg" id="password" name="password" tabindex="2" type="password" />
|
|
<div class="form-group">
|
<div class="col-xs-12">
|
<div class="col-xs-7" style="padding-left: 0;">
|
<input class="form-control input-lg" type="text" name="verifycode" id="verifycode" placeholder="请输入验证码">
|
</div>
|
<div class="col-xs-5" style="padding-right: 0;">
|
<img class="codeimg" style="width: 100px;height: 48px;border-radius: 5px;" src="#" />
|
</div>
|
</div>
|
</div>
|
|
</form>
|
<input class="btn btn-primary btn-block btn-lg submit" data-disable-with="Signing in…" name="commit" tabindex="3" type="button" value="登 录" />
|
</div>
|
|
</div>
|
<script src="./js/jquery.min.js"></script>
|
<script src="./js/bootstrap.min.js"></script>
|
<script src="./layer/layer.js"></script>
|
<script>
|
$(function() {
|
$(".codeimg").attr("src",getSrc());
|
$(".codeimg").click(function() {
|
$(".codeimg").attr("src", getSrc());
|
});
|
|
|
$("body").keydown(function(){
|
if(event.keyCode==13){
|
login();
|
}
|
})
|
|
$(".submit").click(function(e) {
|
login();
|
});
|
});
|
</script>
|
<script>
|
|
function login(){
|
if($("#account").val().length < 1) {
|
layer.msg("请输入正确的账号");
|
return false;
|
}
|
|
if($("#password").val().length < 1) {
|
layer.msg("请输入正确的密码");
|
return false;
|
}
|
|
if($("#verifycode").val().length < 4) {
|
layer.msg("请输入正确的验证码");
|
return false;
|
}
|
|
$.post('api/login/adminLogin', {
|
'username': $("#account").val(),
|
'pwd': $("#password").val(),
|
'code': $("#verifycode").val()
|
}, function(data) {
|
if(data.code == 0) { //登录成功
|
window.location.href = "shuju.html";
|
} else {
|
layer.msg(data.msg);
|
}
|
}, "json");
|
return true;
|
|
}
|
|
function getSrc(){
|
return "api/validate/imgcode?temp="+new Date().getTime();
|
}
|
|
$(function(){
|
$.ajax({
|
url : '../../client/html/api/v1/config/getSystemName',
|
type : 'GET',
|
dataType : 'json',
|
// timeout : 3000, // 设定超时
|
cache : false, // 禁用缓存
|
error : function(request, textStatus, errorThrown) {
|
},
|
success : function(data) {
|
$("body h1").eq(0).html(data.data);
|
$("title").html(data.data);
|
}
|
});
|
});
|
|
</script>
|
</body>
|
|
</html>
|