修复模块服务发现导致的兼容问题
This commit is contained in:
10
catch/wechat/controller/Message.php
Normal file
10
catch/wechat/controller/Message.php
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<?php
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | CatchAdmin [Just Like ~ ]
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | Copyright (c) 2017~2020 http://catchadmin.com All rights reserved.
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | Licensed ( https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt )
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | Author: JaguarJack [ njphper@gmail.com ]
|
||||||
|
// +----------------------------------------------------------------------
|
@@ -205,8 +205,8 @@ class CatchAdmin
|
|||||||
*/
|
*/
|
||||||
public static function getModuleInfo($module)
|
public static function getModuleInfo($module)
|
||||||
{
|
{
|
||||||
if (file_exists(self::moduleDirectory($module) . DIRECTORY_SEPARATOR . 'module.json')) {
|
if (file_exists($module . DIRECTORY_SEPARATOR . 'module.json')) {
|
||||||
return \json_decode(file_get_contents(self::moduleDirectory($module) . DIRECTORY_SEPARATOR . 'module.json'), true);
|
return \json_decode(file_get_contents($module. DIRECTORY_SEPARATOR . 'module.json'), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
return [];
|
return [];
|
||||||
|
@@ -75,18 +75,17 @@ PHP
|
|||||||
*/
|
*/
|
||||||
protected function getServices($module)
|
protected function getServices($module)
|
||||||
{
|
{
|
||||||
$services = [];
|
|
||||||
|
|
||||||
foreach ($this->getModules($module) as $module) {
|
if ($module) {
|
||||||
$information = CatchAdmin::getModuleInfo($module);
|
$moduleInfo = CatchAdmin::getModuleInfo(CatchAdmin::directory() . $module);
|
||||||
if (!empty($information)) {
|
if (isset($moduleInfo['services']) && !empty($moduleInfo['services'])) {
|
||||||
if (isset($information['services']) && !empty($information['services'])) {
|
return $moduleInfo['services'];
|
||||||
$services = array_merge($services, $information['services']);
|
} else {
|
||||||
}
|
return [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $services;
|
return CatchAdmin::getServices();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user