Promise is rejecting OPTIONS request ? In which react life cycle method i should perform this operation

荒凉一梦 提交于 2019-12-11 10:44:56

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!