vue-manage-system
vue-manage-system copied to clipboard
楼主请帮忙看一下这个问题。
[[我设置了vue.config.js里面的proxy代理地址,但是运行的时候没有去走我设置的代理地址。麻烦帮忙看一下。 devServer: { open:true, proxy: { '/api':{ //target:'http://jsonplaceholder.typicode.com', target:'http://localhost:8089', changeOrigin:true, pathRewrite:{'^/api':''} } } }
pathRewrite:{'^/api':''} 是不是要改成这样pathRewrite:{'^/api':'/'}
pathRewrite:{'^/api':''} 是不是要改成这样pathRewrite:{'^/api':'/'}
我改成这样后,还是不可以访问我后台的接口。代理过去的还是8080。是不是axios.create()里面也要配置什么?
这是表示请求 /api 开头的接口时才会走这个代理,你请求的url是否是 /api 开头?域名不能加载请求的url中的;pathRewrite是实际请求的路径没有 /api 的,这个你的后台接口又是否符合