halo-dev / halo

强大易用的开源建站工具。
https://www.halo.run
GNU General Public License v3.0
33.24k stars 9.59k forks source link

文章使用本地附件图片不显示 #5024

Closed lizhengxing1993 closed 8 months ago

lizhengxing1993 commented 9 months ago

系统信息

版本 2.11.1 构建时间 2023-12-02 22:53 Git Commit 54f77d5 Java IBM Semeru Runtime Open Edition / 17.0.9+9 数据库 MySQL Community Server - GPL / 8.1.0 操作系统 Linux 4.18.0-348.7.1.el8_5.x86_64 / amd64

使用的哪种方式运行?

Docker Compose

在线站点地址

http://47.254.43.129:8080/archives/1702100814449

发生了什么?

文章内插入本地附件图片,不显示,看控制台报错资源404

相关日志输出

<body>
  <p style="">思域</p>
  <p style="">1</p>
  <p style=""><img src="null/upload/suyu1.webp" alt="suyu1.webp" style="display: inline-block"></p>
  <p style="">2<img src="null/upload/suyu1.jpg" alt="suyu1.jpg" width="490px" height="368px" style="display: inline-block"></p>
  <p style="">3.png<img src="null/upload/suyu1.png" alt="suyu1.png" style="display: inline-block"></p>
 </body>

附加信息

1702101219282

ruibaby commented 9 months ago

似乎是在插入图片之后,链接前面被添加了 null,导致链接不正确,但我没有复现这个问题。你使用的编辑器是?以及编辑器上是否能够正常显示?

image

/triage needs-information

lizhengxing1993 commented 9 months ago

是的,连接前面被加了null,使用默认编辑器和vditor都会出现这个问题,编辑器上图片可以正常显示,我使用的是 theme-Joe3主题,猜测是主题读取图片路径有问题

ruibaby commented 9 months ago

是的,连接前面被加了null,使用默认编辑器和vditor都会出现这个问题,编辑器上图片可以正常显示,我使用的是

theme-Joe3主题,猜测是主题读取图片路径有问题

建议按照 issue 模板提供你目前已安装的插件,这个可能和有些插件有关。你可以尝试关闭所有插件,看看是否还存在这个问题,然后再一个一个插件开启进行排查。

lizhengxing1993 commented 9 months ago

是的,连接前面被加了null,使用默认编辑器和vditor都会出现这个问题,编辑器上图片可以正常显示,我使用的是 theme-Joe3主题,猜测是主题读取图片路径有问题

建议按照 issue 模板提供你目前已安装的插件,这个可能和有些插件有关。你可以尝试关闭所有插件,看看是否还存在这个问题,然后再一个一个插件开启进行排查。

好的,我尝试一下这个方法 已启动插件: KaTeX WebP Cloud Services 链接管理 Unsplash 图库管理 lightgallery.js 灯箱 对象存储(Amazon S3 协议) 瞬间 AI 助手 Umami Vditor编辑器 Sitemap 搜索组件 RSS 评论组件 应用市场

lizhengxing1993 commented 9 months ago

关闭了所有插件,问题得到了解决,感谢指导!!! 我有时间定位一下是哪个插件的问题

lizhengxing1993 commented 9 months ago

启用 WebP Cloud Services 插件会导致本地附件展示异常,资源链接会错误拼接null

ruibaby commented 9 months ago

启用 WebP Cloud Services 插件会导致本地附件展示异常,资源链接会错误拼接null

那可能是因为你没有在这个插件里设置 Proxy URL。

lizhengxing1993 commented 9 months ago

对的

ruibaby commented 8 months ago

/close

f2c-ci-robot[bot] commented 8 months ago

@ruibaby: Closing this issue.

In response to [this](https://github.com/halo-dev/halo/issues/5024#issuecomment-1873591881): >/close Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.