Browse Source

楼层管理接口2

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

Loading…
Cancel
Save