api网关即使启用也会阻止CORS

时间:2020-08-19 16:59:50

标签: ajax cors aws-api-gateway

enter image description here

enter image description here

尝试使用jquery ajax从我自己的域中调用简单的post


$.ajax({
            dataType: "json",
            type: "POST",
            url:  '/api/v1/tenants/all',
            data: {
                
            },
            success: function (res){
                console.log('success')
                console.log(res);
                drawPlacesOnMap(res.results)
                
            },
            error: function (res){
                console.log('error')
                console.log(res)
                alert(res.responseJSON.error)
            }
        });


被阻止。该请求未到达lambda应用程序。 并已部署

有什么想法吗?

1 个答案:

答案 0 :(得分:-1)

问题出在makePromiseToGetA() .then(makePromiseToGetB) .then((b: B) => sendHttpRequestAxios(b) .then(outputResponse) .catch(handleAxiosError) ) .catch(handleError) :-)

/url更改为/api/v1/tenants/all

相关问题