解决
前端出现跨域问题后,在路由里写入
res.header("Access-Control-Allow-Origin", "*"); res.header("Access-Control-Allow-Headers", "X-Requested-With"); res.header("Access-Control-Allow-Methods", "PUT,POST,GET,DELETE,OPTIONS"); res.header('Access-Control-Allow-Headers', 'Content-Type, Content-Length, Authorization, Accept, X-Requested-With , yourHeaderFeild'); res.header("X-Powered-By", ' 3.2.1') res.header("Content-Type", "application/json;charset=utf-8");
我的 问题解决,记录一下
注意:修改之后重新启动服务器