Browse Source

楼层管理接口2

master
wanghongjun 4 days ago
parent
commit
7759dcfbad
  1. 16
      app/Http/Middleware/AdminAuthMiddleware.php

16
app/Http/Middleware/AdminAuthMiddleware.php

@ -65,19 +65,17 @@ class AdminAuthMiddleware
$contentType = $request->header('Content-Type'); $contentType = $request->header('Content-Type');
if ($request->isMethod('POST') if ($request->isMethod('POST')
&& (!$contentType && (!$contentType
|| !str_contains(
$contentType,
'form/data'
|| !str_contains( || !str_contains(
$contentType, $contentType,
'application/json' 'application/json'
) ))
))
) { ) {
return $this->responseService->error( if (!str_contains($contentType, 'form-data')) {
__('middleware.auth.use_json'), return $this->responseService->error(
400 __('middleware.auth.use_json'),
); 400
);
}
} }
// 检查请求体是否为空对象 // 检查请求体是否为空对象

Loading…
Cancel
Save