1.Node.js服务端处理
app.all('/*', function(req, res, next) {
var origin = req.headers.origin || req.headers.referer
res.header('Access-Control-Allow-Origin',origin)
res.header('Access-Control-Allow-Credentials', 'true')
res.header('Access-Control-Allow-Methods', 'PUT, GET, POST, DELETE, OPTIONS')
res.header('Access-Control-Allow-Headers', 'X-Requested-With')
res.header('Access-Control-Allow-Headers', 'Content-Type')
next()
})
2.vue-resource请求的处理
this.$http.get('http://xxxxx',{ credentials: true }).then(response => {
})