美文网首页
vue跨域简单配置

vue跨域简单配置

作者: Gifted_ | 来源:发表于2021-06-08 15:02 被阅读0次

项目根目录新建vue.config.js

module.exports = {

  publicPath: './',

  devServer: {

    port: 9999,

    proxy: {

      '/ecis': {

        target: '后台接口地址',

        changeOrigin: true,

        pathRewrite: {

          '^/ecis': ''

        }

      }

    }

  }

}

/ecis就指向后台接口地址了

相关文章

网友评论

      本文标题:vue跨域简单配置

      本文链接:https://www.haomeiwen.com/subject/vfqjeltx.html