Skip to content

Commit

Permalink
Update BaseRpc.php
Browse files Browse the repository at this point in the history
  • Loading branch information
lobtao authored and lobtao committed Jun 15, 2019
1 parent 1872442 commit 4f37522
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/BaseRpc.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,11 @@ protected function callFunc($func, $args) {
*/
protected function ajaxReturn($result, $callback) {

$data = json_encode($result, JSON_UNESCAPED_UNICODE);
return $callback ? sprintf('%s(%s)', $callback, $data) : $data;
// $data = json_encode($result, JSON_UNESCAPED_UNICODE);
// return $callback ? sprintf('%s(%s)', $callback, $data) : $data;

return $callback ? jsonp($result) : json($result);

}

/**
Expand Down

0 comments on commit 4f37522

Please sign in to comment.