Skip to content

Commit 9115789

Browse files
authored
Merge pull request laravel-admin-extensions#7 from licxisky/master
避免由 unicode 转码引起的阅读障碍,保障接口数据的原样输出
2 parents 5884bb1 + 2750eb6 commit 9115789

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/ApiTester.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public function parseResponse(Response $response)
121121
$jsoned = json_decode($content);
122122

123123
if (json_last_error() == JSON_ERROR_NONE) {
124-
$content = json_encode($jsoned, JSON_PRETTY_PRINT);
124+
$content = json_encode($jsoned, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);
125125
}
126126

127127
$lang = 'json';
@@ -132,8 +132,8 @@ public function parseResponse(Response $response)
132132
}
133133

134134
return [
135-
'headers' => json_encode($response->headers->all(), JSON_PRETTY_PRINT),
136-
'cookies' => json_encode($response->headers->getCookies(), JSON_PRETTY_PRINT),
135+
'headers' => json_encode($response->headers->all(), JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE),
136+
'cookies' => json_encode($response->headers->getCookies(), JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE),
137137
'content' => $content,
138138
'language' => $lang,
139139
'status' => [

0 commit comments

Comments
 (0)