添加进下面的内容即可
var path = require('path'); var bodyParser = require('body-parser');//用于req.body获取值的 app.use(bodyParser.json()); // 创建 application/x-www-form-urlencoded 编码解析 app.use(bodyParser.urlencoded({ extended: false }));
添加进下面的内容即可
var path = require('path'); var bodyParser = require('body-parser');//用于req.body获取值的 app.use(bodyParser.json()); // 创建 application/x-www-form-urlencoded 编码解析 app.use(bodyParser.urlencoded({ extended: false }));