extjs ueditor 图片_egg-ueditor,基于egg的UEditor百度编辑器后端实现,支持图片/文件上传、列表及图片远程抓取...

egg-ueditor

基于egg的UEditor百度编辑器后端实现,支持图片/文件上传、列表及图片远程抓取

npm install egg-ueditor --save

使用方法

在app/router.js中如下使用

const ueditor = require('egg-ueditor')

app.all('/ueditor', ueditor())

注意:默认上传至egg静态资源目录app/public,若需要上传至其他目录,如下使用:

app.all('/ueditor', ueditor(['assets/public','public']))

参数为一个数组,第1个参数为静态资源相对目录,第2个参数为静态资源url映射路径。

可以修改 UEditor 配置,具体的参数请参考 UEditor 官方的文档

// 需要传UEditor 配置对象

router.all('/ueditor', ueditor({

"imageAllowFiles": [".png", ".jpg", ".jpeg"]

"imagePathFormat": "/upload/ueditor/image/{yyyy}{mm}{dd}/{filename}" // 保存为原文件名

}))

或者

// 需要传UEditor 配置对象

router.all('/ueditor', ueditor(['app/public','public'],{

"imageAllowFiles": [".png", ".jpg", ".jpeg"]

"imagePathFormat": "/upload/ueditor/image/{yyyy}{mm}{dd}/{filename}" // 保存为原文件名

}))

非常感谢您的支持

撸码不易,如果对你有所帮助,欢迎您的赞赏!微信赞赏码:

6e4089f15439fcca87a3dc1963049607.png

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值