php 返回的路径信息里面带/造成麻烦
怎么去掉呢?
先看下之前返回函数
function sys_exit($code = 0, $message = '', $data = []) { $res = [ 'code' => $code, 'msg' => $message, 'data' => $data, 'time' => time() ]; exit(json_encode($res,JSON_UNESCAPED_UNICODE)); }
更改为:
function sys_exit($code = 0, $message = '', $data = []) { $res = [ 'code' => $code, 'msg' => $message, 'data' => $data, 'time' => time() ]; //JSON_UNESCAPED_SLASHES 路径信息带/ exit(json_encode($res,JSON_UNESCAPED_SLASHES)); }
解决。