During development, we used cross-domain because we were in two places, and set it in config/index
proxyTable: {
'/api': {
target: 'http://xxx',
changeOrigin: true,
pathRewrite: {
'^/api': '/api'
}
}
}
Now after building, when putting the project on the server, all interfaces still exist in /api/, but this is no longer needed. Is there any way to do this? The configuration was removed.
Try this
This one on my side is only used locally, and nginx is used as a proxy in the online environment.
After you build, you are no longer running dev-server.
This cross-domain can be ignored