diff --git a/composer.lock b/composer.lock index 26ecaa3af..4d33f5511 100644 --- a/composer.lock +++ b/composer.lock @@ -937,12 +937,12 @@ "source": { "type": "git", "url": "https://github.com/zoujingli/ThinkLibrary.git", - "reference": "adb49d4408625e7a4bb50c3292377d154a10b3d3" + "reference": "dc2052ced8b4edf72914d4276ee35346f43af582" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/adb49d4408625e7a4bb50c3292377d154a10b3d3", - "reference": "adb49d4408625e7a4bb50c3292377d154a10b3d3", + "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/dc2052ced8b4edf72914d4276ee35346f43af582", + "reference": "dc2052ced8b4edf72914d4276ee35346f43af582", "shasum": "", "mirrors": [ { @@ -987,7 +987,7 @@ ], "description": "ThinkPHP v6.0 Development Library", "homepage": "http://thinkadmin.top", - "time": "2020-08-20T05:52:53+00:00" + "time": "2020-08-20T07:41:23+00:00" }, { "name": "zoujingli/wechat-developer", diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index bc5c783aa..0ef09a4e5 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -963,12 +963,12 @@ "source": { "type": "git", "url": "https://github.com/zoujingli/ThinkLibrary.git", - "reference": "adb49d4408625e7a4bb50c3292377d154a10b3d3" + "reference": "dc2052ced8b4edf72914d4276ee35346f43af582" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/adb49d4408625e7a4bb50c3292377d154a10b3d3", - "reference": "adb49d4408625e7a4bb50c3292377d154a10b3d3", + "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/dc2052ced8b4edf72914d4276ee35346f43af582", + "reference": "dc2052ced8b4edf72914d4276ee35346f43af582", "shasum": "", "mirrors": [ { @@ -985,7 +985,7 @@ "ext-mbstring": "*", "topthink/framework": "^6.0" }, - "time": "2020-08-20T05:52:53+00:00", + "time": "2020-08-20T07:41:23+00:00", "type": "library", "extra": { "think": { diff --git a/vendor/services.php b/vendor/services.php index a52defe84..a485eb01d 100644 --- a/vendor/services.php +++ b/vendor/services.php @@ -1,5 +1,5 @@ 'think\\admin\\Library', diff --git a/vendor/zoujingli/think-library/src/multiple/Url.php b/vendor/zoujingli/think-library/src/multiple/Url.php index b0f138140..bc7464ddd 100644 --- a/vendor/zoujingli/think-library/src/multiple/Url.php +++ b/vendor/zoujingli/think-library/src/multiple/Url.php @@ -13,6 +13,8 @@ namespace think\admin\multiple; +use think\helper\Str; + /** * 多应用URL生成与解析 * Class Url @@ -49,7 +51,7 @@ class Url extends \think\route\Url $action = array_pop($path); $controller = empty($path) ? $controller : array_pop($path); $app = empty($path) ? $app : array_pop($path); - $url = $controller . '/' . $action; + $url = Str::snake($controller) . '/' . $action; $bind = $this->app->config->get('app.domain_bind', []); if ($key = array_search($app, $bind)) { isset($bind[$_SERVER['SERVER_NAME']]) && $domain = $_SERVER['SERVER_NAME']; @@ -87,15 +89,15 @@ class Url extends \think\route\Url $anchor = $info['fragment']; if (false !== strpos($anchor, '?')) { // 解析参数 - list($anchor, $info['query']) = explode('?', $anchor, 2); + [$anchor, $info['query']] = explode('?', $anchor, 2); } if (false !== strpos($anchor, '@')) { // 解析域名 - list($anchor, $domain) = explode('@', $anchor, 2); + [$anchor, $domain] = explode('@', $anchor, 2); } } elseif (strpos($url, '@') && false === strpos($url, '\\')) { // 解析域名 - list($url, $domain) = explode('@', $url, 2); + [$url, $domain] = explode('@', $url, 2); } } if ($url) { diff --git a/vendor/zoujingli/think-library/src/service/AdminService.php b/vendor/zoujingli/think-library/src/service/AdminService.php index b02ec34b3..e08fed58d 100644 --- a/vendor/zoujingli/think-library/src/service/AdminService.php +++ b/vendor/zoujingli/think-library/src/service/AdminService.php @@ -17,6 +17,7 @@ namespace think\admin\service; use think\admin\extend\DataExtend; use think\admin\Service; +use think\helper\Str; /** * 系统权限管理服务 @@ -74,8 +75,12 @@ class AdminService extends Service if ($this->isSuper()) return true; $service = NodeService::instance(); [$real, $nodes] = [$service->fullnode($node), $service->getMethods()]; - foreach ($nodes as $key => $rule) if (stripos($key, '_') !== false) { - $nodes[str_replace('_', '', $key)] = $rule; + foreach ($nodes as $key => $rule) { + if (strpos($key, '_') !== false && strpos($key, '/') !== false) { + $attr = explode('/', $key); + $attr[1] = strtr($attr[1], ['_' => '']); + $nodes[join('/', $attr)] = $rule; + } } if (!empty($nodes[$real]['isauth'])) { return in_array($real, $this->app->session->get('user.nodes', [])); diff --git a/vendor/zoujingli/think-library/src/service/NodeService.php b/vendor/zoujingli/think-library/src/service/NodeService.php index 52e8033f3..0b801f608 100644 --- a/vendor/zoujingli/think-library/src/service/NodeService.php +++ b/vendor/zoujingli/think-library/src/service/NodeService.php @@ -102,11 +102,11 @@ class NodeService extends Service $ignores = get_class_methods('\think\admin\Controller'); foreach ($this->_scanDirectory($this->app->getBasePath()) as $file) { if (preg_match("|/(\w+)/(\w+)/controller/(.+)\.php$|i", $file, $matches)) { - list(, $namespace, $appname, $classname) = $matches; - $class = new \ReflectionClass(strtr("{$namespace}/{$appname}/controller/{$classname}", '/', '\\')); + [, $namespace, $appname, $classname] = $matches; $prefix = strtr("{$appname}/{$this->nameTolower($classname)}", '\\', '/'); - $data[$prefix] = $this->_parseComment($class->getDocComment(), $classname); - foreach ($class->getMethods(\ReflectionMethod::IS_PUBLIC) as $method) { + $reflection = new \ReflectionClass(strtr("{$namespace}/{$appname}/controller/{$classname}", '/', '\\')); + $data[$prefix] = $this->_parseComment($reflection->getDocComment(), $classname); + foreach ($reflection->getMethods(\ReflectionMethod::IS_PUBLIC) as $method) { if (in_array($metname = $method->getName(), $ignores)) continue; $data["{$prefix}/{$metname}"] = $this->_parseComment($method->getDocComment(), $metname); }