diff --git a/component/pear/css/pear-module/layer.css b/component/pear/css/pear-module/layer.css index a575002..afb8e4b 100644 --- a/component/pear/css/pear-module/layer.css +++ b/component/pear/css/pear-module/layer.css @@ -1,4 +1,4 @@ .layui-layer-msg{ - border-color: whitesmoke!important; + border-color: transparent!important; box-shadow: 2px 0 6px rgb(0 21 41 / 0.05)!important; } \ No newline at end of file diff --git a/component/pear/modules/admin.js b/component/pear/modules/admin.js index 63bcbcf..e8aecc0 100644 --- a/component/pear/modules/admin.js +++ b/component/pear/modules/admin.js @@ -16,6 +16,9 @@ layui.define(['table', 'jquery', 'element', 'yaml', 'form', 'tab', 'menu', 'fram let sideMenu; let bodyTab; let config; + let logout = function(){ + location.href = "login.html"; + } const body = $('body'); @@ -210,6 +213,11 @@ layui.define(['table', 'jquery', 'element', 'yaml', 'form', 'tab', 'menu', 'fram pearAdmin.removeClass("dark-theme"); pearAdmin.addClass(theme); } + + this.logout = function(callback){ + + logout = callback; + } }; function collaspe() { @@ -227,9 +235,19 @@ layui.define(['table', 'jquery', 'element', 'yaml', 'form', 'tab', 'menu', 'fram admin.addClass("pear-mini"); } } + + body.on("click",".logout",function(){ + // 回调 + var result = logout(); + + if(result){ + // 清空缓存 + bodyTab.clear(); + } + }) body.on("click", ".collaspe,.pear-cover", function() { - collaspe() + collaspe(); }); body.on("click", ".fullScreen", function() { diff --git a/component/pear/modules/tab.js b/component/pear/modules/tab.js index 7085181..db37263 100644 --- a/component/pear/modules/tab.js +++ b/component/pear/modules/tab.js @@ -91,6 +91,11 @@ layui.define(['jquery', 'element'], function(exports) { scrollLeft: autoLeft - $tabTitle.width() / 3 }, 200); } + + pearTab.prototype.clear = function(){ + sessionStorage.removeItem(this.option.elem+"-pear-tab-data"); + sessionStorage.removeItem(this.option.elem+"-pear-tab-data-current"); + } pearTab.prototype.addTab = function(opt) { var title = ''; diff --git a/index.html b/index.html index c4cfe4c..634fc32 100644 --- a/index.html +++ b/index.html @@ -34,7 +34,7 @@