|
|
@@ -67,9 +67,6 @@ class LikeAdminAllowMiddleware
|
|
|
$tenantModel = new Tenant();
|
|
|
//$domain = preg_replace('/^https?:\/\/|\/$/', '', $request->domain());
|
|
|
$domain = $request->header('my-origin-domain');
|
|
|
- if (empty($domain)) {
|
|
|
- return JsonService::fail('非法访问', [], 1001);
|
|
|
- }
|
|
|
$pathSegments = explode('/', $request->pathinfo());
|
|
|
$firstSegment = $pathSegments[0];
|
|
|
|
|
|
@@ -111,6 +108,9 @@ class LikeAdminAllowMiddleware
|
|
|
*/
|
|
|
private function handleTenantAccess(Tenant $tenantModel, string $domain, $request, Closure $next, bool $isPage = false)
|
|
|
{
|
|
|
+ if (empty($domain)) {
|
|
|
+ return JsonService::fail('非法访问', [], -1001);
|
|
|
+ }
|
|
|
// 通过别名访问租户
|
|
|
$tenant = $tenantModel->where(['domain_alias' => $domain])->findOrEmpty();
|
|
|
if (!$tenant->isEmpty() && $tenant->disable === 0 && $tenant->domain_alias_enable === 0) {
|