|
|
@ -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 |
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 检查请求体是否为空对象 |
|
|
// 检查请求体是否为空对象 |
|
|
|