How do vue-cli-generated projects request configuration agents individually?

after the project file from build is deployed on the server, all requests point to the current domain name, and there is no problem with cross-domain.
now the requirement is that some of the requests should be directed to other domain names and cross-domain. This is troublesome. I cannot directly change build to proxyTable, in config > index to proxy all the requests packaged like this. What I do now is to encapsulate a httpconfig in axios for these special requests.

const Axios = axios.create({
    baseURL: isDev() ? "bury/api/atlas/webapp/pv" : "/api/atlas/webapp/pv",
    timeout: 1000 * 30,
    responseType: "json",
    headers: {
        "Content-Type": "application/json;charset=UTF-8"
    },
    proxy: {
        host: process.env.NODE_ENV === "ci" ? "10.20.xx.xxx" : process.env.NODE_ENV === "testing" ? "test-xxx.xxx.com" : "xxx.xxx.com",
        port: process.env.NODE_ENV === "ci" ? "80" : ""
    }
})

but it is not successful. The request still points to the current domain name. What should I do?

Mar.03,2021

in any case, there are cross-domain users like you. In proxyTable, you can share part of Filter's

.
Menu