vue前后端端口不一致解决方案

在config  index.js文件中 引入如下代码即可 proxyTable: { '/api': { target: 'http://localhost:3000',//要访问的后端接口 changeOrigin: true, pathRewrite: { '^/api': '/' //这里的配置是正则表达式,以/api开头的将会被用用‘/api'替换掉,假如后台文档的接口是 /api/li
相关文章
相关标签/搜索