I first determine whether there is cookie information. If not, render the login page (the app.use(/api) will not be routed at this time),
After the user clicks to log in on the login page, ajax sends a post request to api/user/login, and then sends the request again. At this time, I thought it would go through app.use(api) in app.use(), but it didn’t. ...Clicking the page multiple times keeps landing on the login page
What's the problem?
/api and /api/xxx are two routes