node实现ueditor上传接口
步骤
1. 编写接口
特别注意的,ueditor请求分为两块,get请求传递action,post请求传递上传所需参数,在写接口时应写为use
router.use('/ue/upload', api.Upload.ueditorUpload)
2. 获取action
let ActionType = req.query.action
3. 根据action值做对应操作
config
初始化ue组件时客户端会发起get请求传送参数
action=config
, 服务端需返回config.json
配置
(ps:config.json
记得去除所有注释)let preUr