From 251774d0bd02160504e356b21daf938f3d05db4a Mon Sep 17 00:00:00 2001 From: CoolAbc <13836962@qq.com> Date: Sat, 16 Mar 2019 10:35:08 +0800 Subject: [PATCH] 使用Thinkphp内置转换控制器名为c风格,匹配前台访问路径控制器是xxxx_xx的写法;thinkphp默认是将控制器dict_def转成dictDef,fastadmin直接转成小写,造成权限失败.使用thinkphp内置的方法转换控制器名,与前台路径访问保持一致. --- application/common/controller/Backend.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/application/common/controller/Backend.php b/application/common/controller/Backend.php index ce3c239..59b37c0 100644 --- a/application/common/controller/Backend.php +++ b/application/common/controller/Backend.php @@ -7,6 +7,7 @@ use think\Config; use think\Controller; use think\Hook; use think\Lang; +use think\Loader; use think\Session; use fast\Tree; @@ -114,7 +115,7 @@ class Backend extends Controller public function _initialize() { $modulename = $this->request->module(); - $controllername = strtolower($this->request->controller()); + $controllername = Loader::parseName($this->request->controller()); $actionname = strtolower($this->request->action()); $path = str_replace('.', '/', $controllername) . '/' . $actionname; -- libgit2 0.24.0