mirror of
https://github.com/codexu/note-gen.git
synced 2026-04-25 12:55:57 +03:00
[GH-ISSUE #593] [bug] Picgo 远程服务器上传图片,读取图片资源问题 #435
Labels
No labels
bug
duplicate
feature
platform: Android
platform: Linux
platform: Windows
platform: iOS
platform: macOS
priority: high
priority: low
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/note-gen#435
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @longyq20 on GitHub (Aug 31, 2025).
Original GitHub issue: https://github.com/codexu/note-gen/issues/593
详细描述这个 Bug
在远程服务器上搭建了picgo上传服务并配置了跨域访问。
上传图片是提示跨域问题,检查picgo后端日志,报错如下
查看app上传图片的代码
发现貌似是直接把图片路径传进去了,导致在远程服务器上无法读取。
在终端使用上传命令,能够正常上传并返回图片链接
curl -X POST "https://host/upload" \ -F "image=@/path_to_pic.png"NoteGen 版本
v0.20.2
操作系统
macOS
报错日志
No response
@codexu commented on GitHub (Sep 4, 2025):
PicGo 中调用只能传递路径
https://picgo.github.io/PicGo-Doc/zh/guide/advance.html#http%E8%B0%83%E7%94%A8%E4%B8%8A%E4%BC%A0%E5%85%B7%E4%BD%93%E8%B7%AF%E5%BE%84%E5%9B%BE%E7%89%87
你查看一下 /Users/username/Library/Application Support/com.codexu.NoteGen/picgo/58220ab2-73fc-489a-84f4-0fe557b23176.png 是否存在这张图片?
@longyq20 commented on GitHub (Sep 4, 2025):
没有这张图,手动mv进去也没用
@longyq20 commented on GitHub (Sep 4, 2025):
我理解远程部署,即便路径下文件存在,部署picgo的机器也访问不到,那或许应该用类似命令行的表单上传?
curl -X POST "https://host/upload" \ -F "image=@/path_to_pic.png"这样是可以的@codexu commented on GitHub (Sep 4, 2025):
我这边使用 PicGo 是正常的,/Users/username/Library/Application Support/com.codexu.NoteGen/picgo/ 是临时创建的,其中的图片在上传后会删除,你是通过什么才做进行上传图片的?在markdown编辑器中还是插图记录?
@codexu commented on GitHub (Sep 4, 2025):
另外查看一下 PicGo 是否正确?
@longyq20 commented on GitHub (Sep 4, 2025):
在markdown编辑器中粘贴图片
@codexu commented on GitHub (Sep 4, 2025):
我这边的确是可以正常上传,你检查一下是否是你图床有问题?
https://github.com/user-attachments/assets/84266f9f-59b8-4132-aa77-bd38d51bcc35
@longyq20 commented on GitHub (Sep 4, 2025):
嗯,我再试下部署picgo 官方的包。现在用的是piclist-core docker部署
@codexu commented on GitHub (Sep 4, 2025):
#581 提出了使用命令上传图片的方案,这块后续考虑支持一下。
@longyq20 commented on GitHub (Sep 4, 2025):