vue solve problems before and after the end of the cross-domain

1 / In the index.js config

 

 

  // resolve cross-domain 
 proxyTable : {
       '/ API' : {   // Use "/ api" instead of "HTTP: //f.apiplus.c" 
          target : 'http://127.0.0.1:8005', // you need to access the source address need not be suffixed 
          changeOrigin : to true , // address change 
 pathRewrite : { 
             '^ / API': '', // rewritten 127.0.0.1:8005 path API 
            } 
        } 

    },

Note Edit Note, you need to re-use  npm run dev packaged compile the project to validate the configuration

 

access:

 

 

 

 

 

 

 

 

 

 

 

Guess you like

Origin www.cnblogs.com/Rivend/p/11927388.html