-
Notifications
You must be signed in to change notification settings - Fork 482
feat: default editor supports pasting or dragging pictures to upload #825
feat: default editor supports pasting or dragging pictures to upload #825
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
有办法重命名从剪贴板粘贴的图片名称(image.png)么?否则第二次粘贴的时候会出现“附件已存在”错误。
恐怕不是太好判断剪贴板的文件是不是从电脑上复制的,目前仅发现截图之后会有这样的情况,如果单纯根据文件名(image.png)来判断似乎也不合理,因为每一个浏览器都不一样,还可能受到浏览器语言的影响,参考:halo-dev/halo#2945 (comment) 我认为可以像 1.x 一样,在后端判断是否有重复文件,然后重命名。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
文件名重复的问题暂时和当前 PR 无关。
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: JohnNiang The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
这样上传的文件, 如果文章删除, 图片依然在附件里, 如果文章很多, 附件很多, 如果不手动删除附件, 那一直存在系统里, upload文件里 |
目前是这样的。请问有比较好的实现方式么? |
不知道在2.1存不存在这个问题, 2.1是没保存在附件库里, 以前做过类似的, 图片上传的时候给图片重命名, 文件名和文章关联之后, 删除文章也顺便把文件名删除(不过这样 还有一个问题, 2.1->2.2 之后, 文章中的图片无法显示了 想到以前做的废弃的博客网站, 对于几种情况, 图片以及附件处理的方式 如果出现以下的情况:
|
…alo-dev/console#825) #### What type of PR is this? /kind feature #### What this PR does / why we need it: 添加复制或者拖拽图片到编辑器上传的支持。 #### Which issue(s) this PR fixes: Fixes halo-dev#3109 Fixes halo-dev#2946 #### Screenshots: #### Special notes for your reviewer: #### Does this PR introduce a user-facing change? ```release-note Console 端的默认编辑器支持拖拽或者粘贴图片上传 ```
What type of PR is this?
/kind feature
What this PR does / why we need it:
添加复制或者拖拽图片到编辑器上传的支持。
Which issue(s) this PR fixes:
Fixes halo-dev/halo#3109
Fixes halo-dev/halo#2946
Screenshots:
Special notes for your reviewer:
Does this PR introduce a user-facing change?