阅读背景:

vue-resource post请求后台接口报400(跨域问题解决方法)

来源:互联网 

1.打开config/index.js,在proxyTable中添写如下代码

proxyTable: { 

  '/api': {  //使用"/api"来代替"https://f.apiplus.c" 
        target: 'https://f.apiplus.cn', //源地址 
        secure: false,      // 如果是https接口,需要配置这个参数
        changeOrigin: true, //改变源 如果接口跨域,需要进行这个参数配置
        pathRewrite: { 
              '^/api': ' ' //路径重写 
        } 
   } 
}pr



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: