vue3 webpack 代理后的真实地址

vue3 项目在 vue.config.js 中做了下面的代理配置:

const PROXY_LIST = {
  "/dev": {
    target: "http://lcoalhost:7076",
    changeOrigin: true,
    pathRewrite: {
      "^/dev": "/api"
    }
  }
};

我想打印出经过代理后的真实的 URL 要怎么做?

vue3 前端登录后,chrome 网络中的信息如下:(完整)

image.png
preview 标签页中显示:
Proxy error: Could not proxy request /gsms/login/in from localhost:9000 to http://lcoalhost:7076 (ENOTFOUND).

阅读 5k
1 个回答

target: "http://lcoalhost:7076", 换成 target: "http://www.lilnong.top/cors/", 正好我有个服务能看。

其实你这里代理过去是 http://lcoalhost:7076/api/*

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题