1
This commit is contained in:
21
app/admin/middleware/CheckInstall.php
Normal file
21
app/admin/middleware/CheckInstall.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\middleware;
|
||||
|
||||
use app\common\traits\JumpTrait;
|
||||
use app\Request;
|
||||
use Closure;
|
||||
|
||||
class CheckInstall
|
||||
{
|
||||
use JumpTrait;
|
||||
|
||||
public function handle(Request $request, Closure $next)
|
||||
{
|
||||
$controller = $request->controller();
|
||||
if (!is_file(root_path() . 'config' . DIRECTORY_SEPARATOR . 'install' . DIRECTORY_SEPARATOR . 'lock' . DIRECTORY_SEPARATOR . 'install.lock')) {
|
||||
if ($controller != 'Install') return redirect('/install');
|
||||
}
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user