From 1123445f3c793af8b470860b3889649c2da26a6d Mon Sep 17 00:00:00 2001 From: Karson Date: Sun, 21 Jan 2018 14:00:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=90=8E=E5=8F=B0admin?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E4=BB=8D=E7=84=B6=E4=BD=BF=E7=94=A8=E8=B7=AF?= =?UTF-8?q?=E7=94=B1=E7=9A=84BUG=20=E4=BF=AE=E5=A4=8D=E5=90=8E=E5=8F=B0?= =?UTF-8?q?=E5=88=B7=E6=96=B0=E7=89=B9=E6=AE=8A=E6=83=85=E5=86=B5=E4=B8=8B?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E5=8D=A1=E4=B8=8D=E6=98=BE=E7=A4=BA=E6=A0=87?= =?UTF-8?q?=E9=A2=98=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/route.php | 5 ----- public/admin.php | 3 +++ public/assets/js/backend/index.js | 4 +++- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/application/route.php b/application/route.php index 2161d15d..8d936378 100755 --- a/application/route.php +++ b/application/route.php @@ -10,11 +10,6 @@ // | Author: liu21st // +---------------------------------------------------------------------- -//如果有定义绑定后台模块则禁用路由规则 -if (\think\Route::getBind('module') == 'admin'){ - return []; -} - return [ //别名配置,别名只能是映射到控制器且访问时必须加上请求的方法 '__alias__' => [ diff --git a/public/admin.php b/public/admin.php index 9f19b846..a1c1350d 100644 --- a/public/admin.php +++ b/public/admin.php @@ -28,6 +28,9 @@ require __DIR__ . '/../thinkphp/base.php'; // 绑定到admin模块 \think\Route::bind('admin'); +// 关闭路由 +\think\App::route(false); + // 设置根url \think\Url::root(''); diff --git a/public/assets/js/backend/index.js b/public/assets/js/backend/index.js index 3e80037d..7a22fe96 100755 --- a/public/assets/js/backend/index.js +++ b/public/assets/js/backend/index.js @@ -178,6 +178,9 @@ define(['jquery', 'bootstrap', 'backend', 'addtabs', 'adminlte', 'form'], functi } }); + //这一行需要放在点击左侧链接事件之前 + var addtabs = Config.referer ? localStorage.getItem("addtabs") : null; + //绑定tabs事件,如果需要点击强制刷新iframe,则请将iframeForceRefresh置为true $('#nav').addtabs({iframeHeight: "100%", iframeForceRefresh: false}); if ($("ul.sidebar-menu li.active a").size() > 0) { @@ -186,7 +189,6 @@ define(['jquery', 'bootstrap', 'backend', 'addtabs', 'adminlte', 'form'], functi $("ul.sidebar-menu li a[url!='javascript:;']:first").trigger("click"); } //如果是刷新操作则直接返回刷新前的页面 - var addtabs = Config.referer ? localStorage.getItem("addtabs") : null; if (Config.referer) { if (Config.referer === $(addtabs).attr("url")) { var active = $("ul.sidebar-menu li a[addtabs=" + $(addtabs).attr("addtabs") + "]");