是这样的:今天公司干了12年的php哥,问我怎样直接用富文本编辑器把选择的图片传到cdn上,不需要经过服务器处理。他告诉我淘宝就是这么干的,我比较菜,一时难以理解,如果有知道的请给我讲解一下,谢谢!!!
这个是react的,我最近在正好在用 https://github.com/liuhong1happy/react-umeditor 截一下代码,不知道对你有没有用。
getQiniuUploader() { return { url:'http://upload.qiniu.com', type:'qiniu', name:"file", request: "image_src", qiniu:{ app:{ Bucket:"", AK:"l9vEBNTqrz7H03S-", SK:"eizTTxuA0Kq1YSe2SRdOexJ-" }, domain:"http://clouddn.com", genKey:function(options){ return options.file.type +"-"+ options.file.size +"-"+ options.file.lastModifiedDate.valueOf() +"-"+ new Date().valueOf()+"-"+options.file.name; } } } } render() { const icons = this.getIcons() const uploader = this.getQiniuUploader() const plugins = { image:{ uploader:uploader } } return ( <div> <Editor icons={icons} plugins={plugins} value={this.props.value} defaultValue={this.props.defaultValue} onChange={this.props.onChange} /> </div> )
谢谢
123
1231231
@zhangfan6644777 123
CNode 社区为国内最专业的 Node.js 开源技术社区,致力于 Node.js 的技术研究。
这个是react的,我最近在正好在用 https://github.com/liuhong1happy/react-umeditor 截一下代码,不知道对你有没有用。
谢谢
123
1231231
@zhangfan6644777 123