add localhost运行提示

v1.0
bobi 2019-04-30 21:30:31 +08:00
parent f3c1a0d0e1
commit 1829a9c924
1 changed files with 8 additions and 0 deletions

View File

@ -8,6 +8,14 @@ layui.use(["element", "layer"], function () {
var $ = layui.jquery;
var layer = layui.layer;
/**
* localhost运行提示
*/
var href = location.href;
if (href.substring(0, 4) != "http") {
layer.alert("请先部署到 localhost 下再访问");
}
/**
* 左边菜单显示/隐藏功能
* @type {boolean}