config/index.js
proxyTable: { '/api': { target: 'http://10.110.148.59:8085', changeOrigin: true, pathRewrite: { '^/api': '' } } },
请求接口
this.$http.post('/api/lasf-mgr/user/ylogin',params).then((res)=>{ })
浏览器报错
请问怎么配置
导致这个问题最常见的是pathRewrite,这里的/api到底需不需要重写要看后端接口是否带有/api,如果带有/api,那么是不需要重写为空的
pathRewrite
/api
检查下后端接口吧
2.1m questions
2.1m answers
60 comments
56.6k users