\vendor\topthink\framework\src\think\response\Json.php 50行有问题,于是打印了一下显示$data里面有编码问题
找到vendor/topthink/framework/src/think/exception/Handle.php/**
在最后加上下面这个方法
* 将获取的服务器信息中的中文编码转为utf-8
* @access protected
* @param $data array
* @return array 转化后的数组
*/
protected function changeToUtf8(array $data): array
{
foreach ($data as $key => $value) {
$data[$key] = mb_convert_encoding($value, "UTF-8","GBK, GBK2312");
}
return $data;
}
第179行改成
'Server/Request Data' => $this->changeToUtf8($this->app->request->server()),