ComposerUpdate

This commit is contained in:
Anyon 2020-08-20 17:39:31 +08:00
parent b4a2669cab
commit c27f6b336e
6 changed files with 26 additions and 19 deletions

8
composer.lock generated
View File

@ -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",

View File

@ -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": {

2
vendor/services.php vendored
View File

@ -1,5 +1,5 @@
<?php
// This file is automatically generated at:2020-08-20 14:38:32
// This file is automatically generated at:2020-08-20 17:38:41
declare (strict_types = 1);
return array (
0 => 'think\\admin\\Library',

View File

@ -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) {

View File

@ -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', []));

View File

@ -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);
}