Github 图床无法正常显示图片-解决

Github 图床无法正常显示图片-解决

前 言:此篇为上次搭建的 Typora + PicGo + Github 笔记系统续篇,解决 Github 图床无法正常显示图片问题。

方案一:补充本地的hosts文件 (此前已设置过的请看方案二)

1、打开文件: C:\Windows\System32\drivers\etc\hosts

2、在文件末尾添加:

# GitHub Start 
140.82.113.3      github.com
140.82.114.20     gist.github.com
 
151.101.184.133    assets-cdn.github.com
151.101.184.133    raw.githubusercontent.com
151.101.184.133    gist.githubusercontent.com
151.101.184.133    cloud.githubusercontent.com
151.101.184.133    camo.githubusercontent.com
151.101.184.133    avatars0.githubusercontent.com
199.232.68.133     avatars0.githubusercontent.com
199.232.28.133     avatars1.githubusercontent.com
151.101.184.133    avatars1.githubusercontent.com
151.101.184.133    avatars2.githubusercontent.com
199.232.28.133     avatars2.githubusercontent.com
151.101.184.133    avatars3.githubusercontent.com
199.232.68.133     avatars3.githubusercontent.com
151.101.184.133    avatars4.githubusercontent.com
199.232.68.133     avatars4.githubusercontent.com
151.101.184.133    avatars5.githubusercontent.com
199.232.68.133     avatars5.githubusercontent.com
151.101.184.133    avatars6.githubusercontent.com
199.232.68.133     avatars6.githubusercontent.com
151.101.184.133    avatars7.githubusercontent.com
199.232.68.133     avatars7.githubusercontent.com
151.101.184.133    avatars8.githubusercontent.com
199.232.68.133     avatars8.githubusercontent.com
 
# GitHub End

3、保存文件,该刷新的刷新。

方案二:之前一直用好好的,突然出现的问题。具体表现为,可以成功上传 github,但无法正常加载显示,picgo日志报错 HttpError: request to [图片地址] failed, reason: read ECONNRESET。解决如下:

1、typora 里面任意点击一张上传成功的图片查看域名,例如本人的是 raw.githubusercontent.com

image-20230304235010373

2、通过 https://www.ipaddress.com 这个网站,解析域名raw.githubusercontent.com对应的ip地址。

image-20230305000246504

3、回到方案一,打开文件: C:\Windows\System32\drivers\etc\hosts,改动raw.githubusercontent.com 对应正确的IP。

image-20230305000905302

4、保存文件。打开cmd, 执行命令 ipconfig /flushdns 刷新 DNS 解析缓存。

image-20230305001358283

5、重新打开 github 和 typora , 会发现图片可正常加载。

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 4
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值