【发布时间】:2017-04-25 00:36:38
【问题描述】:
我有行动
export function searchInWiki(search) {
const myRequest = new Request(API_URL + search);
const myInit = {
method: 'POST',
mode: 'cors',
headers: {
'Access-Control-Allow-Origin':'*',
'Content-Type':'multipart/form-data',
'Access-Control-Allow-Methods': 'DELETE, HEAD, GET, OPTIONS, POST, PUT',
'Access-Control-Allow-Headers': 'Content-Type, Content-Range, Content-Disposition, Content-Description',
'Access-Control-Max-Age': '1728000'
}
};
return dispatch => fetch(myRequest, myInit)
.then(response => response.json())
.then(json => dispatch(getResults(json)))
}
但我不断收到错误“预检响应无效(重定向)”。你能告诉我如何解决它吗?
【问题讨论】: