app.use(function(req, res, next){
//设置跨域访问
res.header('Access-Control-Allow-Origin', '*');
res.header('Access-Control-Allow-Headers', 'Content-Type, Content-Length, Authorization, Accept, X-Requested-With , yourHeaderFeild');
res.header('Access-Control-Allow-Methods', 'PUT, POST, GET, DELETE, OPTIONS');
next();
})
Vue之axios跨域
最新推荐文章于 2023-01-03 14:38:09 发布