Node Js 跨域

No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.

  • 解决方案
// 原生设置
res.setHeader('Access-Control-Allow-Origin','*')

// express设置
res.header('Access-Control-Allow-Origin', '*');

如果疑问,可加QQ:29727880

你可能感兴趣的:(Node Js 跨域)