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

上一篇下一篇

猜你喜欢

热点阅读