web_toolset/web/admin/html/header.html
2020-06-23 17:33:56 +08:00

75 lines
2.2 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<div class="layui-header">
<div class="layui-logo">管理后台</div>
<ul class="layui-nav layui-layout-left" lay-filter="">
<li class="layui-nav-item" >
<a href="javascript:;"><img src="//t.cn/RCzsdCq" class="layui-nav-img"><span
id='login_text'>登录</span></a>
<dl class="layui-nav-child">
<dd><a href="javascript:;" id="logout">退了</a></dd>
</dl>
</li>
</ul>
</div>
</body>
<script>
let loginStatus = false;
$.get("/login/check.do", function (data) {
let json = JSON.parse(data);
if (json.code == 0) {
$('#login_text').text('已登录')
loginStatus = true;
}
})
$('#login').click(function () {
if (loginStatus) {
return;
}
$.post('/login/sendCaptcha.do', function () {
layer.prompt({
title: '安全登录码'
}, function (value, index, elem) {
$.post('/login/login.do', { code: value }, function (data) {
let json = JSON.parse(data);
layer.msg(json.msg)
window.location.reload()
});
layer.close(index);
})
})
})
$('#logout').click(function () {
$.post('/login/logout.do', function (data) {
let json = JSON.parse(data);
layer.msg(json.msg)
window.location.href = "/"
})
})
// $(document).ready(function () {
// let mobile = navigator.userAgent.toLowerCase().match(/android/i) == "android" || navigator.userAgent.toLowerCase().match(/iphone os/i) == "iphone os";
// if (mobile) {
// $('.layui-body').css('left', '0')
// $('.layui-body').css('top', '150px')
// $('.layui-body').css('height', '200%')
// $('#icon').css('float', 'none')
// } else {
// $('.layui-body').css('padding-right', '100px')
// $('#icon').css('float', 'none')
// }
// })
</script>
<style>
</style>
</html>