Configure proxyTable in the VUE project

For example, local server port +IP address: http://10.2.33.23:8081

Request interface http://10.2.33.20:22008/ctm01ipac/tag/listAll

Modify the configuration: config–>index.js

Dev :{// other configurations of the project omit assetsPublicPath:'/',
    proxyTable: {
        '/api': {
          target: 'http://10.2.33.20:22008', // The request domain name and port of the proxy changeOrigin:true, // Cross-domain pathRewrite: {'^/api': '/ctm01ipac'}}},}Copy the code

Front-end interface request:

export function getLabelField(opts) {
   return http.get('/api/tag/listAll', opts);
}
Copy the code