132 lines
4.5 KiB
HTML
132 lines
4.5 KiB
HTML
|
<!DOCTYPE html>
|
||
|
<html lang="en">
|
||
|
|
||
|
<head>
|
||
|
<meta name="referrer" content="no-referrer"/>
|
||
|
<meta charset="UTF-8">
|
||
|
<title>DD监视器</title>
|
||
|
</head>
|
||
|
|
||
|
<body>
|
||
|
|
||
|
<div class="layui-header">
|
||
|
<ul class="layui-nav" lay-filter="" style="background-color: #1772B4;">
|
||
|
<li class="layui-nav-item">DD监视器</li>
|
||
|
<div id="admin" style="display: inline-block; font-size: 0px;">
|
||
|
<li class="layui-nav-item"><a href="/html/body/bilibili/upInfo.html">UP管理</a>
|
||
|
<dl class="layui-nav-child">
|
||
|
<dd><a href="/html/body/bilibili/video.html">录像</a></dd>
|
||
|
</dl>
|
||
|
</li>
|
||
|
</div>
|
||
|
<li class="layui-nav-item">
|
||
|
<a href="/html/body/bilibili/realTimeData.html">实时数据</a>
|
||
|
</li>
|
||
|
<li class="layui-nav-item">
|
||
|
<a href="/html/body/bilibili/overview.html">数据统计</a>
|
||
|
</li>
|
||
|
<li class="layui-nav-item" id='icon'>
|
||
|
<a href="javascript:;" id="login"><img src="https://static.hdslb.com/images/akari.jpg" class="layui-nav-img"
|
||
|
id="icon_img"><span
|
||
|
id='login_text'>登录</span></a>
|
||
|
<dl class="layui-nav-child">
|
||
|
<dd><a href="/html/body/user.html">设置</a></dd>
|
||
|
<dd><a href="javascript:;" id="logout">退了</a></dd>
|
||
|
</dl>
|
||
|
</li>
|
||
|
</ul>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
</body>
|
||
|
<div id="loginDialog" style="display: none;width: 80%;height: 100%">
|
||
|
<br>
|
||
|
<label class="layui-form-label">账号</label>
|
||
|
<div class="layui-input-block">
|
||
|
<input type="text" id="uname" required="" lay-verify="required" placeholder="请输入账号" autoComplete="off"
|
||
|
class="layui-input">
|
||
|
</div>
|
||
|
<label class="layui-form-label" style="margin-top: 10px">密码</label>
|
||
|
<div class="layui-input-block" style="margin-top: 10px">
|
||
|
<input type="password" id="pass" required="" lay-verify="required" placeholder="请输入密码" autoComplete="off"
|
||
|
class="layui-input">
|
||
|
</div>
|
||
|
</div>
|
||
|
<script>
|
||
|
let loginStatus = false;
|
||
|
$.post('/user/get/test.do', function (json) {
|
||
|
console.log(json)
|
||
|
if (json.code === 0) {
|
||
|
$('#login_text').text(json.data.user);
|
||
|
loginStatus = true;
|
||
|
}
|
||
|
|
||
|
})
|
||
|
|
||
|
$('#login').click(function () {
|
||
|
if (loginStatus) {
|
||
|
return;
|
||
|
}
|
||
|
layer.open({
|
||
|
title: "登陆",
|
||
|
content: $('#loginDialog'),
|
||
|
type: 1,
|
||
|
btn: ['登陆', '注册'],
|
||
|
success: function () {
|
||
|
//new QRCode(document.getElementById("qrcode"), json.url);
|
||
|
},
|
||
|
yes: function (index) {
|
||
|
let uname = $('#uname').val();
|
||
|
let password = $('#pass').val()
|
||
|
$.post('/user/login.do', {user: uname, password: password}, function (json) {
|
||
|
layer.msg(json.msg, function () {
|
||
|
console.log(json)
|
||
|
if (json.code === 0) {
|
||
|
layer.close(index)
|
||
|
$('#loginDialog').css('display', 'none')
|
||
|
}
|
||
|
})
|
||
|
})
|
||
|
},
|
||
|
btn2: function (index) {
|
||
|
let uname = $('#uname').val();
|
||
|
let password = $('#pass').val()
|
||
|
$.post('/user/reg.do', {user: uname, password: password}, function (json) {
|
||
|
layer.msg(json.msg, function () {
|
||
|
console.log(json)
|
||
|
if (json.code === 0) {
|
||
|
layer.close(index)
|
||
|
$('#loginDialog').css('display', 'none')
|
||
|
window.location.reload();
|
||
|
}
|
||
|
})
|
||
|
})
|
||
|
}
|
||
|
|
||
|
})
|
||
|
});
|
||
|
$('#logout').click(function (){
|
||
|
$.post('/user/logout.do',function (json) {
|
||
|
layer.msg(json.msg,function (){
|
||
|
window.location.reload();
|
||
|
})
|
||
|
})
|
||
|
})
|
||
|
$(document).ready(function () {
|
||
|
let mobile = layui.device().mobile;
|
||
|
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', 'right')
|
||
|
}
|
||
|
})
|
||
|
</script>
|
||
|
<style>
|
||
|
</style>
|
||
|
</html>
|