Vue uses the fetch post method 500 error page Cannot read property'*' of undefined

Problem description: Use the fetch.post method in vue to report a 500 error
. Server: Insert picture description here
Client:
Insert picture description here
Result: Insert picture description here
A page with 500 errors.

Solution:
Insert picture description here
Before using the method, add bodyParser, because the body in req.body.id comes from this bodyParser.

After adding:
Insert picture description here

Guess you like

Origin blog.csdn.net/qq_38192709/article/details/110009914