askbot-dragon 1.4.75 → 1.4.77
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
1
2
|
import {multipartUpload, ossFileUrl} from "./AliyunIssUtil";
|
|
2
3
|
import { v4 as uuidv4 } from "uuid";
|
|
3
|
-
const ossConfig={
|
|
4
|
+
const ossConfig = {
|
|
4
5
|
region: "oss-cn-zhangjiakou",
|
|
5
6
|
//云账号AccessKey有所有API访问权限,建议遵循阿里云安全最佳实践,创建并使用STS方式来进行API访问
|
|
6
7
|
accessKeyId: "LTAI4G3QtdEdwkEbihBngAsK",
|
|
@@ -18,7 +19,7 @@ class MyUploadAdapter {
|
|
|
18
19
|
// 启动上载过程
|
|
19
20
|
upload() {
|
|
20
21
|
return this.loader.file
|
|
21
|
-
.then( file => new Promise(
|
|
22
|
+
.then( file => new Promise(() => {
|
|
22
23
|
/* this._initRequest();
|
|
23
24
|
this._initListeners( resolve, reject, file );
|
|
24
25
|
this._sendRequest( file );*/
|
|
@@ -38,7 +39,7 @@ class MyUploadAdapter {
|
|
|
38
39
|
data: uid,
|
|
39
40
|
editable:false,
|
|
40
41
|
type:'upload'
|
|
41
|
-
}
|
|
42
|
+
}
|
|
42
43
|
})
|
|
43
44
|
this.uploadFile(file)
|
|
44
45
|
}));
|
|
@@ -75,7 +76,7 @@ class MyUploadAdapter {
|
|
|
75
76
|
if(attrsList[j] == 'data') {
|
|
76
77
|
// this.editor.uploadImg = this.editor.uploadImg.filter(id =>{return id != attrs.get(attrsList[j])})
|
|
77
78
|
this.editor.model.change(writer => {
|
|
78
|
-
writer.remove(child._children._nodes[index]
|
|
79
|
+
writer.remove(child._children._nodes[index]);
|
|
79
80
|
});
|
|
80
81
|
}
|
|
81
82
|
}
|
|
@@ -93,6 +94,9 @@ class MyUploadAdapter {
|
|
|
93
94
|
src: imgInfo.url
|
|
94
95
|
},
|
|
95
96
|
});
|
|
97
|
+
this.editor.execute('insertParagraph', {
|
|
98
|
+
position: this.editor.model.document.selection.focus
|
|
99
|
+
})
|
|
96
100
|
})
|
|
97
101
|
}
|
|
98
102
|
// 使用传递给构造函数的URL初始化XMLHttpRequest对象.
|
|
@@ -159,6 +163,7 @@ class MyUploadAdapter {
|
|
|
159
163
|
function MyCustomUploadAdapterPlugin( editor ) {
|
|
160
164
|
editor.plugins.get( 'FileRepository' ).createUploadAdapter = ( loader ) => {
|
|
161
165
|
// 在这里将URL配置为后端上载脚本
|
|
166
|
+
console.log(loader,'loader');
|
|
162
167
|
return new MyUploadAdapter( loader,editor );
|
|
163
168
|
}
|
|
164
169
|
}
|
|
@@ -78,6 +78,9 @@ export default class FileCommand extends Command {
|
|
|
78
78
|
src: res.default
|
|
79
79
|
},
|
|
80
80
|
});
|
|
81
|
+
this.editor.execute('insertParagraph', {
|
|
82
|
+
position: this.editor.model.document.selection.focus
|
|
83
|
+
})
|
|
81
84
|
})
|
|
82
85
|
}
|
|
83
86
|
FileUploadCallback({filed, uid, beforeButtonInsert}) {
|