Closed shiliangL closed 5 years ago
这样看的话,和 proxyTable 没关系吧,前端请求发送出去的时候就带上了 tags,是不是请求 URL 写了相对路径
带上 proxyTable 是我猜测可能有关的问题,url 书写的时候是没有 tags 的,然后我在 axios 实例的拦截请求里面打印对应的 url 也是没有 tags 的 所以困惑定位不到问题
所以,我上面写了啊,你是不是写了相对路径
这样的
你就是写了相对路径,改为 /api
好的 感谢 问题以及处理通过了~
如图page/tags/_id.vue 文件中发送的请求路径会带上 http://localhost:3000/tags/api/playlist/detail?id=5001(多带上了 tags字段,前端代理后台配置如下图)
//做了代理 var proxyTable = { // proxy table example '/api': { target: 'http://39.108.65.xxx:3300', changeOrigin: true, pathRewrite: { '^/api': '/' }, } };