fix: 修正中间件、弹窗关闭流程

This commit is contained in:
Ying
2022-08-31 16:19:27 +08:00
parent bc48853cf5
commit c8c3acbbf7
2 changed files with 12 additions and 12 deletions

View File

@@ -37,18 +37,18 @@ class IndexInitialize implements MiddlewareInterface
*/
public function process(Request $request, callable $handler): Response
{
try {
if (saenv('site_status')) {
$content = file_get_contents(root_path('extend/conf/tpl') . 'close.tpl');
$content = str_replace('{text}',saenv('site_notice'),$content);
return \response($content, 503);
}
} catch (\Throwable $th) {
return \response('Web site has been closed', 503);
}
if (!is_file(root_path('extend/conf').'install.lock')) {
if (!is_file(root_path('extend/conf') . 'install.lock')) {
return redirect('/install/index');
} else {
try {
if (saenv('site_status')) {
$content = file_get_contents(root_path('extend/conf/tpl') . 'close.tpl');
$content = str_replace('{text}', saenv('site_notice'), $content);
return \response($content, 503);
}
} catch (\Throwable $th) {
return \response('Web site has been closed', 503);
}
}
$siteInfo = saenv('site', true);