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 d4db8d8 commit 50fab11
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
4 changes: 4 additions & 0 deletions src/common/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ public static function isInstalled()

$config = $connections[$type] ?? [];

if ($config['database'] == '' && $config['username'] == 'root' && $config['password'] == '') {
return false;
}

if ($config['database'] == 'test' && $config['username'] == 'username' && $config['password'] == 'password') {
return false;
}
Expand Down
4 changes: 0 additions & 4 deletions src/common/event/Log.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ public function __construct(App $app)

public function handle($data)
{
if (!Module::isInstalled()) {
return true;
}

$controller = strtolower($this->app->request->controller());
$action = strtolower($this->app->request->action());

Expand Down
15 changes: 11 additions & 4 deletions src/common/middleware/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,11 @@ public function handle($request, Closure $next)
return $response;
}

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

return $next($request);
}
Expand Down Expand Up @@ -85,7 +87,12 @@ protected function setup()
config('dispatch_success_tmpl', $tplPath . 'dispatch_jump.tpl');
config('dispatch_error_tmpl', $tplPath . 'dispatch_jump.tpl');

$config = $instance->getConfig();
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 50fab11

Please sign in to comment.