鍍金池/ 問答/HTML/ vue proxyTable 問題

vue proxyTable 問題

  1. 我的vue proxy代理如下

  dev: {

    // Paths
    assetsSubDirectory: 'static',
    assetsPublicPath: '/',
    proxyTable: {
        '/WoodDepot2':{
            target:'http://starcraft4.tunnel.echomod.cn',
            changeOrigin: true,
            pathRewrite:{
                '^/WoodDepot2':'/WoodDepot2'
            }
        }
    },

然后請求接口是 http://starcraft4.tunnel.echomod.cn/WoodDepot2/user_toLogin.json

我在axios中請求url如下,但是訪問不到,為什么?

  created(){
    axios.get('/WoodDepot2/xx.json',{params:{
    }}).then((res)=>{
      console.log(res)
    })
  }
回答
編輯回答
病癮

target:'http://starcraft4.tunnel.echomod.cn/WoodDepot2'

2017年8月26日 23:18
編輯回答
近義詞

proxyTable下的target改換成,http://starcraft4.tunnel.echo...

2018年1月3日 12:36