我有一个调用函数的动作:
[
{
"key": "ctrl+d",
"command": "editor.action.copyLinesDownAction",
"when": "editorTextFocus"
},
{
"key": "ctrl+shift+up",
"command": "editor.action.moveLinesUpAction",
"when": "editorTextFocus"
},
{
"key": "ctrl+shift+down",
"command": "editor.action.moveLinesDownAction",
"when": "editorTextFocus"
}
]
这里我将数组作为数据传递..
dispatch(Api({url: "my_url", method: "POST", data: data}))
我在import fetch from 'isomorphic-fetch'
export default function Api({url, method, headers, data}={}){
return dispatch => {
console.log(data)
console.log(url)
console.log(method)
console.log(JSON.stringify(data))
let response = fetch(url, {
mode: 'no-cors',
method: method || null,
body: data || null,
}).then(function(response) {
console.log("response");
console.log(response)
});
}
}
使用fetch
我想我正在传递所有争论。我的身体是一个简单的数组,我作为争论传递..
当我看到响应时,它就像:
mode:'no-cors'
我的身体没有被使用..
这里有什么问题?需要帮助