- [0] InvalidArgumentException in Response.php line 316
- variable type error: array
这话意思明白,就是你传入了一个数组,可这是啥意思?我不就是传数组让你转化给前端吗?我再看Response.php哦,原来72行指定路径了,再看核心文件夹指定的有json,jsonp,xml没有数组,哦,原来是缺第四个参数传入你想要的格式如:json
$data = ['aaa'];
$this->result($data,1,'信息','json');
$this->result不用return
参考:
- protected function success($msg = '', $url = null, $data = [], $wait = 1, array $header = [], $target = '_self')
- {
- if (!empty($url) && is_array($data)) {
- $data['url'] = $url;
- }
- return $this->result($data, 1, $msg,'json');
- }
文章点评