CaiYuanYiTiHua/public/bigScreen/login.html

164 lines
5.1 KiB
HTML

<!doctype html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>临沂天空地一体化监测平台</title>
<link rel="stylesheet" type="text/css" href="./css/login.css">
<script src="./js/jquery.min.js"></script>
<script>
var BASE_URL = "http://123.132.248.154:9104";
// var BASE_URL = "http://192.168.10.124:9020";
if(localStorage.getItem("X-Token") == null || localStorage.getItem("X-Token") == ""){
}else{
$.ajax({
type: "GET",
url: BASE_URL + "/api/Check/GetStatus",
dataType: "json",
headers:{"X-Token":localStorage.getItem("X-Token")},
async:false,
beforeSend: function(xhr) {},
success: function(data){
if(data.result == true){
window.location.href="index.html";
}
}
});
}
</script>
</head>
<body>
<div id="logo">
<h1 class="hogo"><i>临沂天空地一体化监测平台</i></h1>
</div>
<section class="stark-login">
<form>
<div id="fade-box">
<input type="text" name="username" id="username" placeholder="用户名" required>
<input type="password" id="password" placeholder="密码" required>
<p id="loginFail" style="font-size:12px;color:red;text-align:left;text-indent:60px;display:none;">用户名或密码错误</p>
<button type="button" id="loginButton">进入系统</button>
</div>
</form>
<div class="hexagons">
<span>&#x2B22;</span>
<span>&#x2B22;</span>
<span>&#x2B22;</span>
<span>&#x2B22;</span>
<span>&#x2B22;</span>
<span>&#x2B22;</span>
<span>&#x2B22;</span>
<span>&#x2B22;</span>
<span>&#x2B22;</span>
<span>&#x2B22;</span>
<span>&#x2B22;</span>
<span>&#x2B22;</span>
<br>
<span>&#x2B22;</span>
<span>&#x2B22;</span>
<span>&#x2B22;</span>
<span>&#x2B22;</span>
<span>&#x2B22;</span>
<span>&#x2B22;</span>
<span>&#x2B22;</span>
<span>&#x2B22;</span>
<span>&#x2B22;</span>
<span>&#x2B22;</span>
<span>&#x2B22;</span>
<br>
<span>&#x2B22;</span>
<span>&#x2B22;</span>
<span>&#x2B22;</span>
<span>&#x2B22;</span>
<span>&#x2B22;</span>
<span>&#x2B22;</span>
<span>&#x2B22;</span>
<span>&#x2B22;</span>
<span>&#x2B22;</span>
<span>&#x2B22;</span>
<span>&#x2B22;</span>
<span>&#x2B22;</span>
<br>
<span>&#x2B22;</span>
<span>&#x2B22;</span>
<span>&#x2B22;</span>
<span>&#x2B22;</span>
<span>&#x2B22;</span>
<span>&#x2B22;</span>
<span>&#x2B22;</span>
<span>&#x2B22;</span>
<span>&#x2B22;</span>
<span>&#x2B22;</span>
<span>&#x2B22;</span>
<br>
<span>&#x2B22;</span>
<span>&#x2B22;</span>
<span>&#x2B22;</span>
<span>&#x2B22;</span>
<span>&#x2B22;</span>
<span>&#x2B22;</span>
<span>&#x2B22;</span>
<span>&#x2B22;</span>
<span>&#x2B22;</span>
<span>&#x2B22;</span>
<span>&#x2B22;</span>
<span>&#x2B22;</span>
</div>
</section>
<div id="circle1">
<div id="inner-cirlce1">
<h2> </h2>
</div>
</div>
<ul>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
</body>
<script>
var BASE_URL = "http://123.132.248.154:9104";
$("#loginButton").click(function(){
var formData = {
"account": $("#username").val(),
"password":$("#password").val(),
"appKey": "openauth"
}
console.log(formData);
$.ajax({
type: "POST",
url: BASE_URL + "/api/Check/Login",
contentType : 'application/json',
dataType: "json",
headers:{"X-Token":localStorage.getItem("X-Token")},
async:false,
data:JSON.stringify(formData),
beforeSend: function(xhr) {},
success: function(data){
if(data.token !=null){
localStorage.setItem("X-Token",data.token);
window.location.href="index.html";
}else{
$("#loginFail").show();
}
}
});
})
$("#username").focus(function(){
$("#loginFail").hide();
})
$("#password").focus(function(){
$("#loginFail").hide();
})
</script>
</html>