Node Js 跨域
2018-08-03 本文已影响0人
3c9a4f007e1b
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