修复权限问题

This commit is contained in:
Anyon 2020-10-29 14:53:31 +08:00
parent 07a197f7b6
commit a93730639c
5 changed files with 16 additions and 15 deletions

View File

@ -941,12 +941,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/zoujingli/ThinkLibrary.git", "url": "https://github.com/zoujingli/ThinkLibrary.git",
"reference": "b34dc9c54a212b3f44b4231eec2218c8da1b98c1" "reference": "4871a421983c89e92e220ae9a30152b6cd6c4504"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/b34dc9c54a212b3f44b4231eec2218c8da1b98c1", "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/4871a421983c89e92e220ae9a30152b6cd6c4504",
"reference": "b34dc9c54a212b3f44b4231eec2218c8da1b98c1", "reference": "4871a421983c89e92e220ae9a30152b6cd6c4504",
"shasum": "", "shasum": "",
"mirrors": [ "mirrors": [
{ {
@ -963,7 +963,7 @@
"ext-mbstring": "*", "ext-mbstring": "*",
"topthink/framework": "^6.0" "topthink/framework": "^6.0"
}, },
"time": "2020-10-29T02:59:49+00:00", "time": "2020-10-29T06:49:03+00:00",
"type": "library", "type": "library",
"extra": { "extra": {
"think": { "think": {

2
vendor/services.php vendored
View File

@ -1,5 +1,5 @@
<?php <?php
// This file is automatically generated at:2020-10-29 11:05:01 // This file is automatically generated at:2020-10-29 14:53:08
declare (strict_types = 1); declare (strict_types = 1);
return array ( return array (
0 => 'think\\admin\\Library', 0 => 'think\\admin\\Library',

View File

@ -41,7 +41,7 @@ class Library extends Service
/** /**
* 版本号 * 版本号
*/ */
const VERSION = '6.0.18'; const VERSION = '6.0.19';
/** /**
* 启动服务 * 启动服务

View File

@ -48,16 +48,17 @@ class NodeService extends Service
public function getCurrent(string $type = ''): string public function getCurrent(string $type = ''): string
{ {
$prefix = $this->app->http->getName(); $prefix = $this->app->http->getName();
if (preg_match("|\\\\addons\\\\{$prefix}$|", $this->app->getNamespace())) { $namespace = $this->app->getNamespace();
$prefix = "addons-{$this->app->http->getName()}"; if (preg_match("|\\\\addons\\\\{$prefix}$|", $namespace)) {
$prefix = "addons-{$prefix}";
} }
// 获取应用前缀节点 // 获取应用前缀节点
if ($type === 'module') return $prefix; if ($type === 'module') return $prefix;
// 获取控制器前缀节点 // 获取控制器前缀节点
$middle = '\\' . $this->nameTolower($this->app->request->controller()); $middle = $this->nameTolower($this->app->request->controller());
if ($type === 'controller') return $prefix . $middle; if ($type === 'controller') return $prefix . '/' . $middle;
// 获取完整的权限节点 // 获取完整的权限节点
return strtolower(strtr($prefix . $middle . $this->app->request->action(), '\\', '/')); return $prefix . '/' . $middle . '/' . strtolower($this->app->request->action());
} }
/** /**

View File

@ -331,10 +331,10 @@ class SystemService extends Service
*/ */
public function doInit(?\think\App $app = null): void public function doInit(?\think\App $app = null): void
{ {
if (is_null($app)) $app = new App(); $this->app = $app ?: $this->app;
$http = $app->debug($this->isDebug())->http; $this->app->debug($this->isDebug());
($response = $http->run())->send(); ($response = $this->app->http->run())->send();
$http->end($response); $this->app->http->end($response);
} }
/** /**