Skip to content

Commit 0d3c51d

Browse files
authored
Merge pull request #11 from GodsMercy/master
修复重大BUG 返回数据错乱
2 parents b802430 + bb939c0 commit 0d3c51d

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

App.php

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -209,30 +209,27 @@ public function ServerJson($data,$option=JSON_UNESCAPED_UNICODE){
209209
Http::header("Content-type: application/json");
210210
//传入0 不做处理
211211
if ($option==0){
212-
$this->conn->send(json_encode($data));
212+
return $this->conn->send(json_encode($data));
213213
}else{
214214

215215
if ($option==JSON_UNESCAPED_UNICODE) {
216216
// json_encode的JSON_UNESCAPED_UNICODE参数 PHP版本必须是5.4以上
217217
if (version_compare(PHP_VERSION,'5.4.0','>=')) {
218-
$this->conn->send(json_encode($data,$option));
218+
return $this->conn->send(json_encode($data,$option));
219219
}else{
220220
// PHP版本小于5.3的支持 未经测试
221-
222221
// 实现方法一 如下 实现方法二 可以使用urldecode函数
223222
// $str = json_encode($data);
224223
// $str = preg_replace_callback("#\\\u([0-9a-f]{4})#i",function($matchs){
225224
// iconv('UCS-2BE', 'UTF-8', pack('H4', $matchs[1]));
226225
// },$str);
227-
// $this->conn->send($str);
228-
$this->conn->send(json_encode($data));
226+
// return $this->conn->send($str);
227+
return $this->conn->send(json_encode($data));
229228
}
230229
}
231230

232231
// 如果传入了别的参数
233-
$this->conn->send(json_encode($data),$option);
234-
235-
232+
return $this->conn->send(json_encode($data),$option);
236233
}
237234
}
238235

0 commit comments

Comments
 (0)