Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ichynul committed Jul 16, 2021
1 parent 234c3c4 commit d78db7b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
4 changes: 0 additions & 4 deletions src/common/behavior/Log.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ class Log
{
public function run($data = [])
{
if (!Module::isInstalled()) {
return;
}

$module = request()->module();

$controller = strtolower(request()->controller());
Expand Down
17 changes: 13 additions & 4 deletions src/common/behavior/Setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ public function run($data = [])

if (strtolower($module) == 'admin') { //admin模块, 替换错误和跳转模板 ,其他事件监听

ExtLoader::watch('tpext_menus', Menu::class, false, '接收菜单创建/删除事件');
ExtLoader::watch('tpext_copy_assets', Assets::class, false, '监视资源刷新,修改版本号');
ExtLoader::watch('app_end', Log::class, false, '记录日志');
if (Module::isInstalled()) {
ExtLoader::watch('tpext_menus', Menu::class, false, '接收菜单创建/删除事件');
ExtLoader::watch('tpext_copy_assets', Assets::class, false, '监视资源刷新,修改版本号');
ExtLoader::watch('app_end', Log::class, false, '记录日志');
}

$instance = Module::getInstance();

Expand All @@ -31,7 +33,14 @@ public function run($data = [])
config('dispatch_success_tmpl', $tplPath . 'dispatch_jump.tpl');
config('dispatch_error_tmpl', $tplPath . 'dispatch_jump.tpl');

$config = $instance->getConfig();
$config = [];

if (Module::isInstalled()) {
$config = $instance->getConfig();
} else {
$config = $instance->defaultConfig();
}

$admin_layout = $rootPath . implode(DIRECTORY_SEPARATOR, ['src', 'admin', 'view', 'layout.html']);

if ($config['minify']) {
Expand Down

0 comments on commit d78db7b

Please sign in to comment.