<?php




namespace app\common\middleware;


use app\Request;
use ln\interfaces\MiddlewareInterface;
use think\Response;

class CheckSiteOpenMiddleware implements MiddlewareInterface
{

    public function handle(Request $request, \Closure $next): Response
    {
        if (systemConfig('site_open') === '0') {
            return app('json')->make(501, '站点已关闭');
        }
        return $next($request);
    }
}