Skip to content

Commit b989776

Browse files
author
pifeng
committed
fix return bug
1 parent 1d8c100 commit b989776

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Middleware/FmtApiResponse.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,11 @@ public function handle($request, Closure $next)
3737
]);
3838
}
3939

40+
$data = json_decode($response->content(), true);
4041
return $this->returnJson([
4142
'code' => 0,
4243
'message' => 'OK',
43-
'data' => is_null(json_decode($response->content(), true)) ?? $response->content(),
44+
'data' => is_null($data) ? $response->content() : $data,
4445
]);
4546
}
4647

0 commit comments

Comments
 (0)