Vue Local Analog post data req.body undefined

the express service is configured locally, and the get request is fine, but the data cannot be obtained when the post request is made. Req.body is always undefined. The corresponding body-parser is also configured, but it doesn"t work

const app = express();
const apiRoutes = express.Router();
const bodyParser = require("body-parser");
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
app.use("/", apiRoutes);
before (app) {
    app.post("/post", (req, res) => {
        console.log(req.body)
      })
   }
Jul.13,2022
Is

cross-domain? has proxy been set


the running time of before is before all the middleware on the server, so it should be that body-parse hasn't been parsed yet, before should be replaced with after, after runs after all middleware, and it should have been parsed

at this time.
Menu