配置本地跨域

 proxyTable: {
        '/api': { //替换代理地址名称
          target: 'http://mall2.idouzi.com/', //代理地址
          changeOrigin: true, //可否跨域
          pathRewrite: {
            '^/api': '' //重写接口,去掉/api
          }
        },
        '/test': { //替换代理地址名称
          target: 'https://security-dev.idouzi.com/', //代理地址
          changeOrigin: true, //可否跨域
          pathRewrite: {
              '^/test': '' //重写接口,去掉/api
          }
        },
        '/idouzi': {
          target: 'http://new.idouzi.com/', //代理地址
          changeOrigin: true, //可否跨域
          pathRewrite: {
              '^/idouzi': '' //重写接口,去掉/api
          }
        }
    }, 

猜你喜欢

转载自blog.csdn.net/chengbin_huang/article/details/80507548