Blogger Information
Blog 22
fans 0
comment 0
visits 26817
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
使用layui异步请求上传图片在tp5.1环境下出现“请对上传接口返回json”的错误的解决方法
kiimi的博客
Original
4642 people have browsed it

正常情况下返回json数据使用return json();

但是使用layui会报错,然后想到了使用json_encode()包装一下用一个变量接收后,再使用return();返回接收json格式的变量,发现还是会报错,

经过网上一番查找,发现直接return  json_encode();即可,不需要使用变量接收在返回。


Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post