-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
1 changed file
with
1 addition
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34657ae
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.
这里应该不能去掉handleUrlEncode, 否则当文件名含有特殊字符时复制的链接还是不能访问的。
例如我上传了一张名为
%eva 副本.jpg
的图片,去掉handleUrlEncode之后复制到的链接是[http://pichoro.test.upcdn.net/%eva 11.jpg](http://pichoro.test.upcdn.net/%eva 11.jpg),这时候访问会报错。
我认为需要修改的是
src/universal/utils/common.ts
里的isUrlEncode
函数,decodeURI
在解码报错的时候,本身就是说明uri未经编码,所以不能直接返回true,而应该返回false.catch里的return修改为false后,再上传拿到的链接是
http://pichoro.test.upcdn.net/%25eva%2011.jpg
,这时候访问和用在markdown里都是正常的了。
34657ae
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.
我想了下,去不去掉都会有问题。不去掉的话,#731 的问题会依然存在,因为多了一层 encode 。
这里需要多加一个配置来处理复制的行为。
return false 我觉得是可以改的。
34657ae
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.
#731 的问题我木有太理解,按理说相册编辑弹出框里的链接本身是未encode过的吧,这时候复制加一层encode应该是没问题的,除非手动把相册的链接改成encode过的了
34657ae
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.
用户自行开发的插件,URL里的内容是无法控制的
34657ae
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.
这倒是。。这样看加个配置是最灵活的。。