Initial commit

This commit is contained in:
net909
2023-09-28 16:21:06 +08:00
parent 498772eb04
commit ba7be004c0
640 changed files with 87745 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
<?php
declare (strict_types = 1);
namespace app\middleware;
use think\facade\Db;
use think\facade\Config;
class LoadConfig
{
/**
* 处理请求
*
* @param \think\Request $request
* @param \Closure $next
* @return Response
*/
public function handle($request, \Closure $next)
{
if (!file_exists(app()->getRootPath().'.env')){
return redirect((string)url('/install'));
}
$res = Db::name('config')->cache('configs',0)->column('value','key');
Config::set($res, 'sys');
return $next($request);
}
}