提交 4b654fba 编写于 作者: KK's avatar KK

富文本组件参数--fix

上级 f0a9480a
...@@ -317,11 +317,31 @@ export default class AppRichTextEditor extends Vue { ...@@ -317,11 +317,31 @@ export default class AppRichTextEditor extends Vue {
images_upload_handler: (bolbinfo: any, success: any, failure: any) => { images_upload_handler: (bolbinfo: any, success: any, failure: any) => {
const formData = new FormData(); const formData = new FormData();
formData.append('file', bolbinfo.blob(), bolbinfo.filename()); formData.append('file', bolbinfo.blob(), bolbinfo.filename());
const _url = richtexteditor.uploadUrl; let _url = richtexteditor.uploadUrl;
if (this.upload_params.length > 0 ) {
_url +='?';
this.upload_params.forEach((item:any,i:any)=>{
_url += `${Object.keys(item)[0]}=${Object.values(item)[0]}`;
if(i<this.upload_params.length-1){
_url += '&';
}
})
}
this.uploadUrl = _url;
richtexteditor.uploadFile(_url, formData).subscribe((file: any) => { richtexteditor.uploadFile(_url, formData).subscribe((file: any) => {
let downloadUrl = richtexteditor.downloadUrl;
if (this.export_params.length > 0) {
downloadUrl +='?';
this.export_params.forEach((item:any,i:any)=>{
downloadUrl += `${Object.keys(item)[0]}=${Object.values(item)[0]}`;
if(i<this.export_params.length-1){
downloadUrl += '&';
}
})
}
if (file.filename) { if (file.filename) {
const id: string = file.fileid; const id: string = file.fileid;
const url: string = `${richtexteditor.downloadUrl}/${id}` const url: string = `${downloadUrl}/${id}`
success(url); success(url);
} }
}, (error: any) => { }, (error: any) => {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册