给转json的地方加JSON_UNESCAPED_SLASHES即可
下面是未加的
$json = json_encode(array(
'code' => 200,
'data' => $dst,
'error' => ''
));
返回前端是:
{"code":200,"data":"https:\/\/xxxx.com\/files\/b73bf4615176deea40dda5aad9c38438.png","error":""}
下面是加的:
$json = json_encode(array(
'code' => 200,
'data' => $dst,
'error' => ''
),JSON_UNESCAPED_SLASHES);
返回前端是:
{“code”:200,“data”:“https://xxxx.com/files/b73bf4615176deea40dda5aad9c38438.png”,“error”:""}