mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-02 03:48:13 +08:00
fix:富文本编辑器tinymce模式上传图片问题 (#2395)
This commit is contained in:
parent
3d9ce28ae9
commit
d0af689fe9
@ -1,11 +1,5 @@
|
||||
{
|
||||
"status": 0,
|
||||
"msg": "ok",
|
||||
"data": {
|
||||
"value":
|
||||
"https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=3893101144,2877209892&fm=23&gp=0.jpg",
|
||||
"url": "https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=3893101144,2877209892&fm=23&gp=0.jpg",
|
||||
"filename": "dog.jpg"
|
||||
}
|
||||
}
|
||||
|
||||
"status": 0,
|
||||
"msg": "ok",
|
||||
"link": "https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=3893101144,2877209892&fm=23&gp=0.jpg"
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ import {FormItem, FormControlProps, FormBaseControl} from './Item';
|
||||
import cx from 'classnames';
|
||||
import LazyComponent from '../../components/LazyComponent';
|
||||
import {tokenize} from '../../utils/tpl-builtin';
|
||||
import {normalizeApi} from '../../utils/api';
|
||||
|
||||
/**
|
||||
* RichText
|
||||
@ -189,7 +190,16 @@ export default class RichTextControl extends React.Component<
|
||||
const formData = new FormData();
|
||||
formData.append('file', blobInfo.blob(), blobInfo.filename());
|
||||
try {
|
||||
const response = await fetcher(props.receiver, formData, {
|
||||
const receiver = {
|
||||
adaptor: (payload: object) => {
|
||||
return {
|
||||
...payload,
|
||||
data: payload
|
||||
};
|
||||
},
|
||||
...normalizeApi(props.receiver)
|
||||
};
|
||||
const response = await fetcher(receiver, formData, {
|
||||
method: 'post'
|
||||
});
|
||||
if (response.ok) {
|
||||
|
Loading…
Reference in New Issue
Block a user