Vue-cli 3.x build the project, why use the path of node agent / users/1//3 to report 404?

I built the project with vue-cli 3.x, and the agent configuration in vue.config.js is as follows

module.exports = {
    devServer: {
        proxy: {
            "/api": {
                target: "https://XXX.xinxiuw.cn",
                changeOrigin: true,
                ws: true,
                pathRewrite: {
                }
            },
        }
    }
}

the interface address given by the backend is / api/users/:userId/:bookId/:mId

if userId is 1 bookId is""mId is 3
, then the request address is / api/users/1//3
development environment. I use node as a proxy and request / api/users/1//3 to report 404. But if the test environment uses nginx as a proxy, the request can be successful.

is the default node proxy middleware for vue-cli 3.x unable to proxy requests with / / in the path?

how to solve this problem?

Aug.28,2021
Menu