## 编辑器上传图片
~~~[api:auth]
post:/CompetitionProject/upload
*int:project_id#项目ID
*file:file#文件
<<<
success
{
"uploaded": 1,
"fileName": "eva5_press.png",
"url": "https:\/\/cas-cms-file.makercas.com\/CompetitionArea\/6e5536cb0992c3223081ee8c60e06784.png",
"error": {
"message": "上传成功"
}
}
<<<
error
{
"uploaded": 0,
"error": {
"message": "项目未找到"
}
}
~~~
## 字段列表
| 字段 | 说明 |
| --- | --- |
| uploaded | 状态:0失败,1成功 |
| url | 文件地址 |
| fileName | 文件名 |
| error | 错误信息 |
## 编辑器代码
```html
<script src="/static/ckeditor/ckeditor.js"></script>
<script>
CKEDITOR.replace(document.getElementById('editor'), {
toolbarGroups: [
{ name: 'tools', groups: [ 'tools' ] },
{ name: 'insert', groups: [ 'insert' ] },
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
{ name: 'paragraph', groups: [ 'list', 'indent', 'align'] },
],
height: '20em',
removeButtons: 'ShowBlocks,Flash,HorizontalRule,Smiley,SpecialChar,PageBreak,Iframe',
language: 'zh-cn',
filebrowserImageUploadUrl: "/index/CompetitionProject/upload?project_id=项目ID",
contentsCss: [],
});
</script>
```