首页登陆替换成Google身份验证器
新增配置工具类 更新页面
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
<a href="javascript:;">工具集</a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd><a href="/html/body/tools/password.html">密码管理器</a></dd>
|
||||
<dd><a href="javascript:;" id="open_pc">远程开机</a></dd>
|
||||
</dl>
|
||||
</li>
|
||||
<li class="layui-nav-item">
|
||||
@@ -38,11 +39,12 @@
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
<script src="../js/qrcode.min.js"></script>
|
||||
<script>
|
||||
let loginStatus = false;
|
||||
$.get("/login/check.do", function (data) {
|
||||
let json = JSON.parse(data);
|
||||
if (json.code == 0) {
|
||||
if (json.code === 0) {
|
||||
$('#login_text').text('已登录')
|
||||
loginStatus = true;
|
||||
}
|
||||
@@ -51,7 +53,27 @@
|
||||
if (loginStatus) {
|
||||
return;
|
||||
}
|
||||
$.post('/login/sendCaptcha.do', function () {
|
||||
$.post('/login/sendCaptcha.do', function (data) {
|
||||
let json=JSON.parse(data);
|
||||
if(json.code===1){
|
||||
layer.open({
|
||||
title:"使用Google身份验证器绑定",
|
||||
content:"<div id=\"qrcode\"></div>",
|
||||
success:function () {
|
||||
new QRCode(document.getElementById("qrcode"), json.data);
|
||||
},
|
||||
yes:function (index) {
|
||||
layer.close(index)
|
||||
openLoginCode();
|
||||
}
|
||||
|
||||
})
|
||||
}else{
|
||||
openLoginCode();
|
||||
}
|
||||
|
||||
})
|
||||
function openLoginCode() {
|
||||
layer.prompt({
|
||||
title: '安全登录码'
|
||||
}, function (value, index, elem) {
|
||||
@@ -62,7 +84,7 @@
|
||||
});
|
||||
layer.close(index);
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
$('#logout').click(function () {
|
||||
$.post('/login/logout.do', function (data) {
|
||||
@@ -70,6 +92,16 @@
|
||||
layer.msg(json.msg)
|
||||
window.location.href = "/"
|
||||
})
|
||||
});
|
||||
$('#open_pc').click(function () {
|
||||
layer.open({
|
||||
title:"msg",
|
||||
content: "确定开机?",
|
||||
yes:function (index) {
|
||||
$.post("/tools/openpc.do");
|
||||
layer.close(index)
|
||||
}
|
||||
})
|
||||
})
|
||||
$(document).ready(function () {
|
||||
let mobile = navigator.userAgent.toLowerCase().match(/android/i) == "android" || navigator.userAgent.toLowerCase().match(/iphone os/i) == "iphone os";
|
||||
|
||||
Reference in New Issue
Block a user