请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

关于 Proxy 报错 404

Dell 老师好,最近才买了这个课程,配置 Proxy 一直报错 404,vue-cli 版本是 4.5,该如何解决呢?
图片描述

正在回答 回答被采纳积分+3

插入代码

1回答

Dell 2021-12-06 23:45:19

你把内容放到 public 里面试试,有可能 static 已经不支持了

0 回复 有任何疑惑可以回复我~
  • 提问者 吃啥都爱蘸辣椒 #1
    我按照您在 Cli 版本迁移的课程里放在了 public 下,还是报错 404 
    Request URL: http://localhost:8080/api/index.json
    Request Method: GET
    Status Code: 404 Not Found
    Remote Address: 127.0.0.1:8080
    Referrer Policy: strict-origin-when-cross-origin
    connection: close
    content-length: 161
    content-security-policy: default-src 'none'
    content-type: text/html; charset=utf-8
    date: Wed, 08 Dec 2021 10:19:37 GMT
    x-content-type-options: nosniff
    x-powered-by: Express
    Accept: application/json, text/plain, */*
    Accept-Encoding: gzip, deflate, br
    Accept-Language: zh-CN,zh;q=0.9
    Cache-Control: no-cache
    Connection: keep-alive
    Host: localhost:8080
    Pragma: no-cache
    Referer: http://localhost:8080/
    Sec-Fetch-Dest: empty
    Sec-Fetch-Mode: cors
    Sec-Fetch-Site: same-origin
    User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1
    回复 有任何疑惑可以回复我~ 2021-12-08 18:23:48
  • Dell 回复 提问者 吃啥都爱蘸辣椒 #2
    不管放在public还是static里面,是不是都不能直接 http://localhost:8080/api/index.json 访问?
    回复 有任何疑惑可以回复我~ 2021-12-09 00:10:24
  • 提问者 吃啥都爱蘸辣椒 回复 Dell #3
    谢谢老师,已经解决了
    回复 有任何疑惑可以回复我~ 2021-12-09 09:00:04
问题已解决,确定采纳
还有疑问,暂不采纳
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号