|
请问:
1、如何跨域请求后端接口
2、header如何传json,用{'Content-Type': 'application/json'}方法报错
handling fail, code=200
handling fail, data=The value of 'content-type' isn't supported when post json object
onInit () {
fetch.fetch({
url:"http://192.168.1.90:9840/smart/menu/getMenuData",
data:{"publicnumid":"293828096774123520","type":1},
method:"POST",
header:{'Content-Type': 'application/json'},
success:function(data){
console.log("title: " + JSON.parse(data.data));
},
fail: function(data, code) {
console.log("handling fail, code=" + code);
console.log("handling fail, data=" + data);
}
})
} |
|