- admin: 路由守卫修复空白页、addRoute、devServer 端口与代理 - admin: package.json 生产构建去掉 NODE_OPTIONS openssl - ajcaptcha: 滑块验证码改用 file 缓存避免 Redis NOAUTH - nginx-crmeb: 增加 81 端口站点 - docs: deploy 补充 NOAUTH/Redis 说明,新增 H5 部署脚本与 nginx 示例 - 其他: database、start-api、swoole ini、uniapp 资源等 Made-with: Cursor
39 lines
1.4 KiB
PHP
39 lines
1.4 KiB
PHP
<?php
|
||
// +----------------------------------------------------------------------
|
||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||
// +----------------------------------------------------------------------
|
||
// | Copyright (c) 2016~2026 https://www.crmeb.com All rights reserved.
|
||
// +----------------------------------------------------------------------
|
||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||
// +----------------------------------------------------------------------
|
||
// | Author: CRMEB Team <admin@crmeb.com>
|
||
// +----------------------------------------------------------------------
|
||
|
||
namespace app\http\middleware;
|
||
|
||
|
||
use app\Request;
|
||
use crmeb\interfaces\MiddlewareInterface;
|
||
|
||
/**
|
||
* Class InstallMiddleware
|
||
* @package app\http\middleware
|
||
*/
|
||
class InstallMiddleware implements MiddlewareInterface
|
||
{
|
||
|
||
public function handle(Request $request, \Closure $next)
|
||
{
|
||
// CORS 预检请求不重定向,交给后续 AllowOriginMiddleware 返回 200 + CORS 头
|
||
if (strtoupper($request->method()) === 'OPTIONS') {
|
||
return $next($request);
|
||
}
|
||
//检测是否已安装CRMEB系统
|
||
if (!is_dir(root_path() . "public/install/") || !is_file(root_path() . "public/install/install.lock")) {
|
||
return redirect('/install/index');
|
||
}
|
||
|
||
return $next($request);
|
||
}
|
||
}
|