问题
getAllOrganization: function() {
return new Promise(function(resolve, reject) {
request.fetch(latas.API_ENDPOINT.organizationApi).then(function(result) {
if(result.status) {
resolve(result.data); console.log('hi success');
} else { console.log('rejected');
reject(result.message);
}
}, function(error) { console.log('errorr');
reject(latas.MESSAGES.SOMETHING_WENT_WRONG);
});
});
}
Above is my code [Promise] Which is rejecting after OPTIONS request call. I just want GET request ,I want to bypass OPTIONS request.
来源:https://stackoverflow.com/questions/35498403/promise-is-rejecting-options-request-in-which-react-life-cycle-method-i-should