分享经验 版主:论坛审计组
如何实现百度编辑器插入附件时,URL标题为附件原名字
类型:迅睿CMS 更新时间:2024-04-25 15:49:06 百度编辑器 配置文件

如何实现百度编辑器插入附件时,URL标题为附件原名字?

官方默认插入的时候是附件随机名称;

如下:

5c77a54917a28eaf1c73dcc99188fcb7


通过修改实现插入时,自动调用为附件原名称:

如下:


image


方法一:

搜索:\api\ueditor\ueditor.all.min.js
color:#0066cc;" href="'+r.url+'" title="'+s+'">'+name+"</a>
把以上代码修改为
color:#0066cc;" href="'+r.url+'" title="'+s+'">'+s+"</a>

这个办法,附件上传后依旧是随机名,但是在插入编辑器时,会显示原文件名!


方法二:

修改配置文件:\api\ueditor\php\config.php
44行:
"filePathFormat" => "/ueditor/file/{yyyy}{mm}/{time}{rand:6}",
改为
"filePathFormat" => "/ueditor/file/{yyyy}{mm}/{filename}_{time}",