首页 文章

AngularJS $ .ajax问题

提问于
浏览
-1

XMLHttpRequest无法加载http://192.168.1.134:8888/pivot/api/report/uploadReport . 预检的响应具有无效的HTTP状态代码404

我收到了这个错误 . 有人有想法吗?

var settings = {
    "async": true,
    "crossDomain": true,
    "url": baseURL + "report/uploadReport",
    "method": "POST",
    "headers": {
        "token": window.localStorage['token']
    },
    "data": {
        "rating": rating,
        "desc": desc,
        "spot_id": window.localStorage['spotId'],
        "image_name": path
    }
};

console.log(settings);
$.ajax(settings).done(
    function(response) {
        console.log(response);
    }
);

这是调用ajax的代码部分 . 谢谢

1 回答

  • 1

    预检的响应具有无效的HTTP状态代码404

    404表示服务器找不到请求资源 . 您正在点击没有定义路线的URL . 您需要告诉服务器该路由的响应内容 .

相关问题