Browse Source

楼层管理接口2

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

6
app/Http/Middleware/AdminAuthMiddleware.php

@ -65,20 +65,18 @@ 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'
)
)) ))
) { ) {
if (!str_contains($contentType, 'form-data')) {
return $this->responseService->error( return $this->responseService->error(
__('middleware.auth.use_json'), __('middleware.auth.use_json'),
400 400
); );
} }
}
// 检查请求体是否为空对象 // 检查请求体是否为空对象
if ($request->isMethod('POST') && $request->getContent() === '') { if ($request->isMethod('POST') && $request->getContent() === '') {

Loading…
Cancel
Save