vue-admin-template icon indicating copy to clipboard operation
vue-admin-template copied to clipboard

请问代理失败怎么解决 Proxy error: Could not proxy request

Open zhou997 opened this issue 5 years ago • 20 comments

后端可以是访问的 配置了proxy 捕获 捕获2 捕获3

zhou997 avatar Aug 09 '19 10:08 zhou997

问题解决了,通过在api写死url 有其他解决方案吗?

zhou997 avatar Aug 09 '19 11:08 zhou997

问题解决了,通过在api写死url 有其他解决方案吗?

我的Mac也遇到了这个问题,然后在vue.config.js里面,吧proxy的target改成http://127.0.0.1:...省略..这样就好了,可以试一试

hcyfreedom avatar Aug 15 '19 08:08 hcyfreedom

求问具体解决方法,项目搞下来启动登录就报这个错了

shu-dty avatar Aug 19 '19 00:08 shu-dty

npm install [email protected] 安装这个低版本的模块就可以了

LokMon avatar Aug 19 '19 09:08 LokMon

"resolutions": { "@vue/cli-service/portfinder": "1.0.21" } add it to package.json can fix it.

wxzen avatar Aug 21 '19 02:08 wxzen

同样的问题,试了楼上两位大佬的方法也还是不行,不过我在Win10的系统没有问题,但是在Win7系统上就有问题,这跟系统有关系么?

pythonzm avatar Aug 22 '19 01:08 pythonzm

我也有这问题, 死活不行

Skura23 avatar Apr 26 '20 16:04 Skura23

我记得是本地dns有问题,加上这个dns即可:127.0.0.1 localhost  或者配置为127.0.0.1而不是localhost

------------------ Original ------------------ From: "PajamaCat"<[email protected]>; Date: Mon, Apr 27, 2020 00:05 AM To: "PanJiaChen/vue-admin-template"<[email protected]>; Cc: "山东大学 韩楚怡"<[email protected]>;"Comment"<[email protected]>; Subject: Re: [PanJiaChen/vue-admin-template] 请问代理失败怎么解决 Proxy error: Could not proxy request (#452)

我也有这问题, 死活不行

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

hcyfreedom avatar May 16 '20 07:05 hcyfreedom

解决了,只需要在URL前面加个http://

RuMaxwell avatar Jul 10 '20 05:07 RuMaxwell

终于找到原因了,把vue.config.js中的 before: require('./mock/mock-server.js'),注释掉,应该是走代理前走了mockjs

zhangyuanliang avatar Sep 04 '20 03:09 zhangyuanliang

终于找到原因了,把vue.config.js中的 before: require('./mock/mock-server.js'),注释掉,应该是走代理前走了mockjs

去掉之后首页登陆不进去了啊,请问大佬是怎么解决掉

LgJianzhao avatar Nov 04 '20 13:11 LgJianzhao

我也遇到同样的问题,是我这边vue.config.js 配置的域名,mac 的 DNS 解析不了,解决方法是找相关的后台开发人员拿IP,然后修改 MAC 的 host 文件,配置域名代理即可。

pxhbb1224 avatar Feb 02 '21 02:02 pxhbb1224

所以怎么解决的

mmlu123 avatar May 26 '21 09:05 mmlu123

上述都试过了

mmlu123 avatar May 26 '21 09:05 mmlu123

我也遇到同样的问题,是我这边vue.config.js 配置的域名,mac 的 DNS 解析不了,解决方法是找相关的后台开发人员拿IP,然后修改 MAC 的 host 文件,配置域名代理即可。

我今天突然发现代理的接口报错,然而我上一秒还是好的,一报错我就懵了,最后把域名换成ip就好了。所以我怀疑是域名的解析有问题

chenbingchang avatar May 28 '21 07:05 chenbingchang

试了以上方法都没用,最后发现是前后端项目端口不一致导致的。改成一样的就解决了

我的前后端分离项目是基于 https://github.com/yangzongzhuan/RuoYi 开发的,但是希望能给大家提供一点思路。

bitbeluga avatar Jul 27 '21 06:07 bitbeluga

這vue的反向代理就是垃圾,莫名其妙的問題,提示也不夠準確,127.0.0.1偶爾行,偶爾不行 還必須改localhost,真tmd智障

qx avatar Apr 12 '22 01:04 qx

我是这样解决的 https://blog.csdn.net/zxxzxx23/article/details/120716926

Skura23 avatar Apr 12 '22 05:04 Skura23

将localhost改成127.0.0.1居然可以了。。。

zszszszsz avatar May 05 '23 08:05 zszszszsz

将localhost改成127.0.0.1居然可以了。。。

不行,都2024年了,居然都没修复?

lh1215 avatar Jan 30 '24 06:01 lh1215