proxy 代理地址

请求地址: `url: '/api/usermodule/user/verificationode',`

proxy: {
  '/api': {
    target: 'http://yd.msword.top', //API服务器的地址
    ws: true, //代理websockets
    changeOrigin: true, // 是否跨域,虚拟的站点需要更管origin
    pathRewrite: {
      // '^/api'是一个正则表达式,表示要匹配请求的url中,
      //全部'http://localhost:8081/api5' 转接为 http://localhost:8081/api/
      //重写路径 比如'/api/aaa/ccc'重写为'/aaa/ccc'
      '^/api': 'api',
    }
  }
},
posted @ 2021-11-05 14:05  云霄紫潭  阅读(720)  评论(0编辑  收藏  举报