Cannot find the request address after the Vue project is packaged?

/ config/index.js

proxyTable: {
    // proxy all requests starting with /api to jsonplaceholder
    "/api": {
        target: "https://xxxxxxx.com/",
        changeOrigin: true,//
        changeOrigin: true,
        pathRewrite: {
            "^/api": ""
        }
    }
},
The response can be obtained normally in

development mode, and the request can be sent to the test server, but can not be found after packaging.

error report * n:
Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:9000/api/app/getCheckNumImg.action

the picture won"t come up, so let"s replace it with words.

how do you make the packaged request point to the real test server address?

Mar.01,2021

the dev_server used in development is only for development. After packaging, the request agent configured in dev_server is no longer valid.
just change the path to the address of the server!
eg: directly https://xxxxxxx.com/.

Menu