✨ 重构安装方式
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace app\http\middleware;
|
||||
|
||||
use think\Request;
|
||||
|
||||
class Init
|
||||
{
|
||||
public function handle(Request $request, \Closure $next)
|
||||
{
|
||||
// 检测程序是否已安装
|
||||
if (!file_exists(app()->getAppPath() . 'install.lock')) {
|
||||
if ($request->controller(true) !== 'install' || $request->action(true) !== 'index') {
|
||||
return redirect(url('install/index'));
|
||||
}
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user