// 设置允许跨域访问该服务 app.all('*', function (req, res, next) { res.header("Access-Control-Allow-Origin", "*"); res.header('Access-Control-Allow-Methods', 'PUT, GET, POST, DELETE, OPTIONS'); res.header("Access-Control-Allow-Headers", "X-Requested-With, Content-Type, mytoken"); next(); });
标签:Control,服务器端,Allow,res,Access,header,设置,跨域 From: https://www.cnblogs.com/wangxianwen/p/16776821.html