当我使用桌面浏览器发送请求时,我工作得很好但是当我发送移动响应时这样:
这是我的资源代码:
app.factory('Category', function($resource) {
return {
get: $resource('example.com/user/profile/category', null, {
query: {
method: 'GET',
headers: {'Content-Type': 'application/json'},
responseType: 'json',
transformResponse: [],
}
}),
}
});
此问题仅出现在手机上!当我使用桌面时,每件事都可以! 那么为什么当移动设备中的浏览器发送选项req时有响应(文本类型)但桌面响应是空的?
答案 0 :(得分:0)
答案是transformResponse: [],
我们应该删除它!