askbot-dragon 88.0.36 → 888.0.1
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 +1 -1
- package/src/assets/js/AliyunlssUtil.js +6 -6
- package/src/components/ConversationContainer.vue +0 -1
- package/src/components/MyEditor.vue +12 -14
- package/src/components/askVideo.vue +119 -122
- package/src/components/formTemplate.vue +45 -50
- package/src/components/utils/ckeditor.js +16 -19
package/package.json
CHANGED
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
const OSS = window.OSS
|
|
6
6
|
|
|
7
7
|
const ossConfig={
|
|
8
|
-
region: "oss-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
region: "oss-ap-southeast-1",
|
|
9
|
+
//云账号AccessKey有所有API访问权限,建议遵循阿里云安全最佳实践,创建并使用STS方式来进行API访问
|
|
10
|
+
accessKeyId: "LTAI5tAusPLDNJJwkvUbqi2T",
|
|
11
|
+
accessKeySecret: "xqPVaunOIbvTe3g9qsXal2IZO6RftK",
|
|
12
|
+
// stsToken: '<Your securityToken(STS)>',
|
|
13
|
+
bucket: "askbotopen-ls",
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
let IDX = 256, HEX = [], SIZE = 256, BUFFER;
|
|
@@ -67,7 +67,6 @@
|
|
|
67
67
|
import TextMessage from '@/components/message/TextMessage'
|
|
68
68
|
import FormTemplate from "@/components/formTemplate";
|
|
69
69
|
|
|
70
|
-
import FormTemplate from "@/components/formTemplate";
|
|
71
70
|
/* import TextMessage from "@/components/message/TextMessage";*/
|
|
72
71
|
|
|
73
72
|
// import FormTemplate from '@/components/formTemplate'
|
|
@@ -36,20 +36,19 @@
|
|
|
36
36
|
|
|
37
37
|
<script>
|
|
38
38
|
import { v4 as uuidv4 } from "uuid";
|
|
39
|
-
|
|
40
|
-
import { putObject } from "../assets/js/obsBrowser";
|
|
39
|
+
import { multipartUpload, ossFileUrl } from "./utils/AliyunIssUtil";
|
|
41
40
|
|
|
42
41
|
export default {
|
|
43
42
|
props: ["value", "placeholder", "havToolbar"],
|
|
44
43
|
data () {
|
|
45
44
|
return {
|
|
46
45
|
ossConfig: {
|
|
47
|
-
region: "oss-
|
|
46
|
+
region: "oss-ap-southeast-1",
|
|
48
47
|
//云账号AccessKey有所有API访问权限,建议遵循阿里云安全最佳实践,创建并使用STS方式来进行API访问
|
|
49
|
-
accessKeyId: "
|
|
50
|
-
accessKeySecret: "
|
|
48
|
+
accessKeyId: "LTAI5tAusPLDNJJwkvUbqi2T",
|
|
49
|
+
accessKeySecret: "xqPVaunOIbvTe3g9qsXal2IZO6RftK",
|
|
51
50
|
// stsToken: '<Your securityToken(STS)>',
|
|
52
|
-
bucket: "
|
|
51
|
+
bucket: "askbotopen-ls",
|
|
53
52
|
},
|
|
54
53
|
ischecked: false,
|
|
55
54
|
text: ''
|
|
@@ -159,15 +158,14 @@ export default {
|
|
|
159
158
|
let imgInfo = {
|
|
160
159
|
url: '',
|
|
161
160
|
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
let res = putObject(file)
|
|
161
|
+
let res = multipartUpload(
|
|
162
|
+
this.ossConfig,
|
|
163
|
+
file,
|
|
164
|
+
null,
|
|
165
|
+
imgInfo
|
|
166
|
+
);
|
|
169
167
|
res.then(resp => {
|
|
170
|
-
imgInfo.url = resp.
|
|
168
|
+
imgInfo.url = ossFileUrl(this.ossConfig, resp.name)
|
|
171
169
|
resolve({
|
|
172
170
|
name: resp.name,
|
|
173
171
|
default: imgInfo.url
|
|
@@ -1,142 +1,139 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
2
|
+
<div
|
|
3
|
+
v-loading="loading"
|
|
4
|
+
:element-loading-text="showProgress"
|
|
5
|
+
id="dragon-video"
|
|
6
|
+
>
|
|
7
|
+
<!-- <video-player
|
|
8
|
+
class="video-player vjs-custom-skin"
|
|
9
|
+
x5-video-player-type="h5"
|
|
10
|
+
:options="videoOptions(msg.content,msg.type)"
|
|
11
|
+
@pause="statechanged"
|
|
12
|
+
/> -->
|
|
13
|
+
<video
|
|
14
|
+
controls="controls"
|
|
15
|
+
:controlslist="nodownload&&'nodownload'"
|
|
16
|
+
:raw-controls="true"
|
|
17
|
+
x5-video-player-type="h5-page"
|
|
18
|
+
style="object-fit: contain;width: calc(100vw - 139px);height: 160px;background-color: black;border-radius: 25px;max-width: 230px;padding-left: 10px"
|
|
19
|
+
preload
|
|
20
|
+
:poster="videoSrc+'?spm=qipa250&x-oss-process=video/snapshot,t_1000,f_jpg,w_0,h_0,m_fast'"
|
|
21
|
+
class="video-player vjs-custom-skin"
|
|
22
|
+
:id="msg.id+'key'">
|
|
23
|
+
<source :src="videoSrc"/>
|
|
24
|
+
</video>
|
|
25
|
+
<div id="output"></div>
|
|
26
|
+
</div>
|
|
27
27
|
</template>
|
|
28
28
|
<script>
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
export default {
|
|
32
|
-
name: "ask_video",
|
|
33
|
-
props: ["msg", "url", "localUrl", "progress", "nodownload"],
|
|
34
|
-
data() {
|
|
35
|
-
return {
|
|
36
|
-
videoSrc:'',
|
|
37
|
-
poster:''
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
watch: {
|
|
41
|
-
},
|
|
42
|
-
computed: {
|
|
43
|
-
showProgress() {
|
|
44
|
-
return parseInt(this.progress * 100);
|
|
45
|
-
},
|
|
46
|
-
loading() {
|
|
47
|
-
return this.url == null || this.url === "";
|
|
48
|
-
},
|
|
49
|
-
src() {
|
|
50
|
-
return this.url ? this.url : this.localUrl;
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
mounted() {
|
|
54
|
-
this.$nextTick(()=>{
|
|
55
|
-
let videoSrc = this.url ? this.url : this.localUrl
|
|
56
|
-
let newVideoSrc = videoSrc.replace("https://guoranopen-zjk.oss-cn-zhangjiakou.aliyuncs.com","https://static.guoranbot.com")
|
|
57
|
-
this.videoSrc = newVideoSrc
|
|
58
|
-
console.debug('newVideoSrc',this.videoSrc,videoSrc)
|
|
59
|
-
this.poster = this.videoSrc+'?spm=qipa250&x-oss-process=video/snapshot,t_1000,f_jpg,w_0,h_0,m_fast'
|
|
60
|
-
console.debug('poster',this.poster)
|
|
61
|
-
})
|
|
29
|
+
import {ossConfig,uploadImageByBase64} from "../assets/js/AliyunlssUtil";
|
|
62
30
|
|
|
31
|
+
export default {
|
|
32
|
+
name: "ask_video",
|
|
33
|
+
props: ["msg", "url", "localUrl", "progress", "nodownload"],
|
|
34
|
+
data() {
|
|
35
|
+
return {
|
|
36
|
+
videoSrc:'',
|
|
37
|
+
poster:''
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
watch: {
|
|
63
41
|
},
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
42
|
+
computed: {
|
|
43
|
+
showProgress() {
|
|
44
|
+
return parseInt(this.progress * 100);
|
|
45
|
+
},
|
|
46
|
+
loading() {
|
|
47
|
+
return this.url == null || this.url === "";
|
|
48
|
+
},
|
|
49
|
+
src() {
|
|
50
|
+
return this.url ? this.url : this.localUrl;
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
mounted() {
|
|
54
|
+
this.$nextTick(()=>{
|
|
55
|
+
let videoSrc = this.url ? this.url : this.localUrl
|
|
56
|
+
let newVideoSrc = videoSrc.replace("https://guoranopen-zjk.oss-cn-zhangjiakou.aliyuncs.com","https://static.guoranbot.com")
|
|
57
|
+
this.videoSrc = newVideoSrc
|
|
58
|
+
console.debug('newVideoSrc',this.videoSrc,videoSrc)
|
|
59
|
+
this.poster = this.videoSrc+'?spm=qipa250&x-oss-process=video/snapshot,t_1000,f_jpg,w_0,h_0,m_fast'
|
|
60
|
+
console.debug('poster',this.poster)
|
|
61
|
+
})
|
|
69
62
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
63
|
+
},
|
|
64
|
+
methods:{
|
|
65
|
+
getImage(){
|
|
66
|
+
let that = this
|
|
67
|
+
var video,output;
|
|
68
|
+
var scale = 0.8;
|
|
76
69
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
70
|
+
var initialize = function() {
|
|
71
|
+
let id = that.msg.keyId+'key'
|
|
72
|
+
output = document.getElementById("output");
|
|
73
|
+
video = document.getElementById(id);
|
|
74
|
+
video.addEventListener('loadeddata',captureImage);
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
var captureImage = function() {
|
|
78
|
+
var canvas = document.createElement("canvas");
|
|
79
|
+
canvas.width = video.videoWidth * scale;
|
|
80
|
+
canvas.height = video.videoHeight * scale;
|
|
81
|
+
canvas.getContext('2d').drawImage(video, 0, 0, canvas.width, canvas.height);
|
|
82
|
+
/*var img = document.createElement("img");
|
|
83
|
+
img.crossOrigin = 'anonymous'
|
|
84
|
+
img.src = canvas.toDataURL("image/png");*/
|
|
85
|
+
let reg = /\.(png|jpg|gif)$/
|
|
86
|
+
console.debug('img.src',output)
|
|
87
|
+
let base64 = canvas.toDataURL("image/png")
|
|
88
|
+
let blob = that.dataURLtoFile(base64,'name')
|
|
89
|
+
let promise = uploadImageByBase64(ossConfig,blob);
|
|
90
|
+
promise.then((res)=>{
|
|
91
|
+
console.debug("upload base64 reslut",res);
|
|
92
|
+
if (res&&res.url){
|
|
93
|
+
that.poster = res.url
|
|
94
|
+
if (!reg.test(that.poster)){
|
|
95
|
+
that.poster +='.png'
|
|
100
96
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
};
|
|
97
|
+
}
|
|
98
|
+
console.debug('poster',that.poster)
|
|
99
|
+
});
|
|
100
|
+
};
|
|
104
101
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
}
|
|
116
|
-
//转换成file对象
|
|
117
|
-
return new File([u8arr], filename, {type:mime});
|
|
118
|
-
//转换成成blob对象
|
|
119
|
-
/*return new Blob([u8arr],{type:'image/png'});*/
|
|
102
|
+
initialize();
|
|
103
|
+
},
|
|
104
|
+
dataURLtoFile(dataurl, filename) {
|
|
105
|
+
var arr = dataurl.split(',');
|
|
106
|
+
var mime = arr[0].match(/:(.*?);/)[1];
|
|
107
|
+
var bstr = atob(arr[1]);
|
|
108
|
+
var n = bstr.length;
|
|
109
|
+
var u8arr = new Uint8Array(n);
|
|
110
|
+
while(n--){
|
|
111
|
+
u8arr[n] = bstr.charCodeAt(n);
|
|
120
112
|
}
|
|
113
|
+
//转换成file对象
|
|
114
|
+
return new File([u8arr], filename, {type:mime});
|
|
115
|
+
//转换成成blob对象
|
|
116
|
+
/*return new Blob([u8arr],{type:'image/png'});*/
|
|
121
117
|
}
|
|
122
|
-
|
|
123
118
|
}
|
|
119
|
+
|
|
120
|
+
}
|
|
124
121
|
</script>
|
|
125
122
|
<style scoped lang="less">
|
|
126
123
|
video::-webkit-media-controls-mute-button { display: none !important;}
|
|
127
124
|
#dragon-video{
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
}
|
|
138
|
-
|
|
125
|
+
position: relative;
|
|
126
|
+
#outputVideo{
|
|
127
|
+
position: absolute;
|
|
128
|
+
top: 0px;
|
|
129
|
+
/deep/img{
|
|
130
|
+
width: calc(100vw - 139px);
|
|
131
|
+
border-radius: 25px;
|
|
132
|
+
max-width: 230px;
|
|
133
|
+
height: 160px;
|
|
139
134
|
}
|
|
135
|
+
|
|
136
|
+
}
|
|
140
137
|
}
|
|
141
138
|
|
|
142
139
|
</style>
|
|
@@ -869,7 +869,6 @@ import Tree from '../components/tree'
|
|
|
869
869
|
import selectPopup from '../components/popup'
|
|
870
870
|
import fileListView from './fielListView.vue'
|
|
871
871
|
import { uniqueData } from './utils/math_utils'
|
|
872
|
-
import { putObject } from "../assets/js/obsBrowser";
|
|
873
872
|
export default {
|
|
874
873
|
name: "formTemplate",
|
|
875
874
|
data() {
|
|
@@ -945,12 +944,12 @@ export default {
|
|
|
945
944
|
fileType:['PICTURE','VIDEO','AUDIO'],
|
|
946
945
|
loading:'',
|
|
947
946
|
ossConfig: {
|
|
948
|
-
region: "oss-
|
|
947
|
+
region: "oss-ap-southeast-1",
|
|
949
948
|
//云账号AccessKey有所有API访问权限,建议遵循阿里云安全最佳实践,创建并使用STS方式来进行API访问
|
|
950
|
-
accessKeyId: "
|
|
951
|
-
accessKeySecret: "
|
|
949
|
+
accessKeyId: "LTAI5tAusPLDNJJwkvUbqi2T",
|
|
950
|
+
accessKeySecret: "xqPVaunOIbvTe3g9qsXal2IZO6RftK",
|
|
952
951
|
// stsToken: '<Your securityToken(STS)>',
|
|
953
|
-
bucket: "
|
|
952
|
+
bucket: "askbotopen-ls",
|
|
954
953
|
},
|
|
955
954
|
hideUploadEdit:false,
|
|
956
955
|
limitNum:1,
|
|
@@ -1636,43 +1635,40 @@ export default {
|
|
|
1636
1635
|
}
|
|
1637
1636
|
}
|
|
1638
1637
|
},
|
|
1639
|
-
uploadImgFun(content,name,fileCon,file){
|
|
1638
|
+
uploadImgFun (content, name, fileCon, file) {
|
|
1640
1639
|
console.log(fileCon)
|
|
1641
1640
|
let imageData = {
|
|
1642
|
-
urls:[]
|
|
1641
|
+
urls: []
|
|
1643
1642
|
}
|
|
1644
1643
|
let imageInfo = {
|
|
1645
|
-
name:"",
|
|
1646
|
-
status:'',
|
|
1647
|
-
url:''
|
|
1648
|
-
}
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
resp.then((res) => {
|
|
1644
|
+
name: "",
|
|
1645
|
+
status: '',
|
|
1646
|
+
url: ''
|
|
1647
|
+
}
|
|
1648
|
+
let res = multipartUpload(
|
|
1649
|
+
this.ossConfig,
|
|
1650
|
+
file,
|
|
1651
|
+
null,
|
|
1652
|
+
imageInfo
|
|
1653
|
+
);
|
|
1654
|
+
res.then((res) => {
|
|
1657
1655
|
console.log("upload result:", res);
|
|
1658
1656
|
// let filePath = res.name;
|
|
1659
|
-
|
|
1660
|
-
name:file.name,
|
|
1661
|
-
url:res.
|
|
1662
|
-
status:'success'
|
|
1663
|
-
}
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
imageInfo.
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
if (this.extInfoFieldValue[this.filedId][j].content && this.extInfoFieldValue[this.filedId][j].content === content){
|
|
1671
|
-
this.$set(this.extInfoFieldValue[this.filedId],j,imageInfo)
|
|
1657
|
+
imageData.urls.push({
|
|
1658
|
+
name: file.name,
|
|
1659
|
+
url: ossFileUrl(this.ossConfig, res.name),
|
|
1660
|
+
status: 'success'
|
|
1661
|
+
})
|
|
1662
|
+
imageInfo.url = ossFileUrl(this.ossConfig, res.name)
|
|
1663
|
+
imageInfo.status = 'success'
|
|
1664
|
+
imageInfo.name = file.name
|
|
1665
|
+
for (let j = 0; j < this.extInfoFieldValue[this.filedId].length; j++) {
|
|
1666
|
+
if (this.extInfoFieldValue[this.filedId][j].content && this.extInfoFieldValue[this.filedId][j].content === content) {
|
|
1667
|
+
this.$set(this.extInfoFieldValue[this.filedId], j, imageInfo)
|
|
1672
1668
|
delete this.extInfoFieldValue[this.filedId][j].content
|
|
1673
1669
|
}
|
|
1674
1670
|
}
|
|
1675
|
-
this.fileUpload=false
|
|
1671
|
+
this.fileUpload = false
|
|
1676
1672
|
}).catch((err) => {
|
|
1677
1673
|
console.debug("upload err", err);
|
|
1678
1674
|
});
|
|
@@ -2557,7 +2553,7 @@ export default {
|
|
|
2557
2553
|
onCancel() {
|
|
2558
2554
|
this.showArea = false;
|
|
2559
2555
|
},
|
|
2560
|
-
aliyunOssRequest(data){
|
|
2556
|
+
aliyunOssRequest (data) {
|
|
2561
2557
|
|
|
2562
2558
|
this.loading = this.$loading({
|
|
2563
2559
|
lock: true,
|
|
@@ -2568,9 +2564,9 @@ export default {
|
|
|
2568
2564
|
let file = data.file;
|
|
2569
2565
|
console.debug("upload file:", file);
|
|
2570
2566
|
let imgInfo = {
|
|
2571
|
-
status:'',
|
|
2572
|
-
url:'',
|
|
2573
|
-
name:''
|
|
2567
|
+
status: '',
|
|
2568
|
+
url: '',
|
|
2569
|
+
name: ''
|
|
2574
2570
|
}
|
|
2575
2571
|
/* let imageData = {
|
|
2576
2572
|
id:cid,
|
|
@@ -2581,14 +2577,13 @@ export default {
|
|
|
2581
2577
|
progress: 0,
|
|
2582
2578
|
},
|
|
2583
2579
|
};*/
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
ress.then((res) => {
|
|
2580
|
+
let res = multipartUpload(
|
|
2581
|
+
this.ossConfig,
|
|
2582
|
+
file,
|
|
2583
|
+
null,
|
|
2584
|
+
imgInfo
|
|
2585
|
+
);
|
|
2586
|
+
res.then((res) => {
|
|
2592
2587
|
console.debug("upload result:", res);
|
|
2593
2588
|
// let filePath = res.name;
|
|
2594
2589
|
/* imageData.content.progress = 1;
|
|
@@ -2596,14 +2591,14 @@ export default {
|
|
|
2596
2591
|
ossFileUrl(this.ossConfig, res.name)
|
|
2597
2592
|
);
|
|
2598
2593
|
console.log('imageData',imageData)*/
|
|
2599
|
-
imgInfo.url = res.
|
|
2600
|
-
imgInfo.status='success'
|
|
2601
|
-
if (data.file){
|
|
2594
|
+
imgInfo.url = ossFileUrl(this.ossConfig, res.name)
|
|
2595
|
+
imgInfo.status = 'success'
|
|
2596
|
+
if (data.file) {
|
|
2602
2597
|
imgInfo.name = data.file.name
|
|
2603
2598
|
imgInfo.uid = data.file.uid
|
|
2604
2599
|
}
|
|
2605
|
-
if (!this.extInfoFieldValue[this.filedId]){
|
|
2606
|
-
this.$set(this.extInfoFieldValue,this.filedId,[])
|
|
2600
|
+
if (!this.extInfoFieldValue[this.filedId]) {
|
|
2601
|
+
this.$set(this.extInfoFieldValue, this.filedId, [])
|
|
2607
2602
|
}
|
|
2608
2603
|
this.extInfoFieldValue[this.filedId].push(imgInfo)
|
|
2609
2604
|
this.loading.close()
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
|
-
|
|
2
|
+
import {multipartUpload, ossFileUrl} from "./AliyunIssUtil";
|
|
3
3
|
import { v4 as uuidv4 } from "uuid";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
//
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
// }
|
|
4
|
+
const ossConfig = {
|
|
5
|
+
region: "oss-ap-southeast-1",
|
|
6
|
+
//云账号AccessKey有所有API访问权限,建议遵循阿里云安全最佳实践,创建并使用STS方式来进行API访问
|
|
7
|
+
accessKeyId: "LTAI5tAusPLDNJJwkvUbqi2T",
|
|
8
|
+
accessKeySecret: "xqPVaunOIbvTe3g9qsXal2IZO6RftK",
|
|
9
|
+
// stsToken: '<Your securityToken(STS)>',
|
|
10
|
+
bucket: "askbotopen-ls",
|
|
11
|
+
}
|
|
13
12
|
class MyUploadAdapter {
|
|
14
13
|
constructor( loader , editor ) {
|
|
15
14
|
// 要在上载期间使用的文件加载器实例
|
|
@@ -56,16 +55,14 @@ class MyUploadAdapter {
|
|
|
56
55
|
let imgInfo = {
|
|
57
56
|
url:'',
|
|
58
57
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
let res = putObject(file);
|
|
58
|
+
let res = multipartUpload(
|
|
59
|
+
ossConfig,
|
|
60
|
+
file,
|
|
61
|
+
null,
|
|
62
|
+
imgInfo
|
|
63
|
+
);
|
|
66
64
|
res.then(resp=>{
|
|
67
|
-
|
|
68
|
-
imgInfo.url = resp.url;
|
|
65
|
+
imgInfo.url = ossFileUrl(ossConfig, resp.name)
|
|
69
66
|
let root = this.editor.model.document.getRoot()
|
|
70
67
|
let children = root.getChildren()
|
|
71
68
|
for(let child of children){
|