服务器返回403,那是服务器禁止了跨域访问了吧。在服务器返回时加上 res.header('Access-Control-Allow-Origin', '*'); res.header("Access-Control-Allow-Headers", "Content-Type,Content-Length, Authorization, Accept,X-Requested-With"); res.header("Access-Control-Allow-Methods","PUT,POST,GET,DELETE,OPTIONS"); 上面这几段是expressjs的写法
服务器返回403,那是服务器禁止了跨域访问了吧。
在服务器返回时加上
res.header('Access-Control-Allow-Origin', '*');
res.header("Access-Control-Allow-Headers", "Content-Type,Content-Length, Authorization, Accept,X-Requested-With");
res.header("Access-Control-Allow-Methods","PUT,POST,GET,DELETE,OPTIONS");
上面这几段是expressjs的写法