You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

46 lines
1.4 KiB

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>101</title>
<!--#include file="/widget/head.html"-->
</head>
<body class="layui-layout-body" layadmin-themealias="green-header">
<script src="bower_components/jquery/dist/jquery.min.js"></script>
<script src="bower_components/cookie/cookie.min.js"></script>
<script type="text/javascript">
$(function(){
var token = cookie.get("token");
console.log(token);
if (token && token.length > 0) {
$.getJSON(Page.SvrIp+"/api/auth", { token: token }, function(data) {
if (data.ret != 0) {
if (data.ret != 1) {
// 请登录就不弹提示了
alert(data.msg);
}
// 后台认证不通过,弹登录界面
location.href = "pages/login.html";
return;
}
// 认证通过
location.href = "pages/index.html";
});
} else {
// 本地认证不通过,弹登录界面
location.href = "pages/login.html";
}
});
</script>
</body>
</html>