askbot-dragon 88.1.1 → 88.1.3
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,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "askbot-dragon",
|
|
3
|
-
"version": "88.1.
|
|
3
|
+
"version": "88.1.3",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"serve": "vue-cli-service serve",
|
|
6
6
|
"build": "vue-cli-service build",
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
"@vue/cli-plugin-eslint": "~4.5.0",
|
|
12
12
|
"@vue/cli-service": "~4.5.0",
|
|
13
13
|
"audio-loader": "^1.0.3",
|
|
14
|
+
"axios": "^1.8.4",
|
|
14
15
|
"babel-eslint": "^10.1.0",
|
|
15
16
|
"core-js": "^3.6.5",
|
|
16
17
|
"element-ui": "^2.15.10",
|
|
@@ -1,11 +1,49 @@
|
|
|
1
1
|
// 创建ObsClient实例
|
|
2
2
|
import ObsClient from 'esdk-obs-browserjs';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
import axios from 'axios';
|
|
4
|
+
|
|
5
|
+
let accessKeyId = ""
|
|
6
|
+
let accessKeySecret = ""
|
|
7
|
+
if (localStorage.getItem('VUE_APP_SOURCE' == 'libang_production')) {
|
|
8
|
+
accessKeyId = "XsVgbg1mDU/xiVxPeNsaIwGmhF+jSZ0ep79YuqOjHk8=";
|
|
9
|
+
accessKeySecret = "nBcMSflABN+A5bsaoaeVVI8FeYRaVXkCVZl2m/aC89Q/0uuWEP1f47W/i1jvNXBF";
|
|
10
|
+
} else {
|
|
11
|
+
accessKeyId = "6c8a/rXhOM4z0ph78Q09j0J2N+7CKuLA+tt34PvscOI=";
|
|
12
|
+
accessKeySecret = "dzvV5NBuufJDAckKgGjXbKcLiMhZ67Eoi/4Jt0M7cpYnuPWbL5k/oD0O0U4dRnCI";
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
async function getDecryptedKeys() {
|
|
16
|
+
try {
|
|
17
|
+
const response = await axios.post('/knowledge-api/secret/manager/decrypt', {
|
|
18
|
+
accessKeyId: accessKeyId,
|
|
19
|
+
accessKeySecret: accessKeySecret
|
|
20
|
+
});
|
|
21
|
+
if (response.data.code === '0') {
|
|
22
|
+
return response.data.data;
|
|
23
|
+
} else {
|
|
24
|
+
console.error('获取失败,错误码:', response.data.code);
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
} catch (error) {
|
|
28
|
+
console.error('获取出错:', error);
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// 创建 ObsClient 实例
|
|
34
|
+
async function createObsClient() {
|
|
35
|
+
const keys = await getDecryptedKeys();
|
|
36
|
+
if (!keys) {
|
|
37
|
+
throw new Error('无法获取解密后的密钥');
|
|
38
|
+
}
|
|
39
|
+
return new ObsClient({
|
|
40
|
+
access_key_id: keys.accessKeyId,
|
|
41
|
+
secret_access_key: keys.accessKeySecret,
|
|
42
|
+
server: 'https://obs.cn-east-3.myhuaweicloud.com',
|
|
43
|
+
timeout: 1000
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
9
47
|
let mainId = sessionStorage.getItem('_mainId') ? sessionStorage.getItem('_mainId') : "";
|
|
10
48
|
let IDX = 256, HEX = [], SIZE = 256, BUFFER;
|
|
11
49
|
while (IDX--) HEX[IDX] = (IDX + 256).toString(16).substring(1);
|
|
@@ -40,6 +78,7 @@ async function putObject(file,callback){
|
|
|
40
78
|
let objName = (process.env.VUE_APP_ENV === 'development' ? 'dev_' : 'pro_') + file.name;
|
|
41
79
|
let fileName = "front-oss/" + mainId + '/' + dataFormat("yyyy/MM/dd/hh/mm/") + uid(32) + "/" + objName;
|
|
42
80
|
let bucketName = localStorage.getItem('askObsBucketName') || 'askbot-uat';
|
|
81
|
+
const obsClient = await createObsClient();
|
|
43
82
|
await obsClient.putObject({
|
|
44
83
|
Bucket: bucketName,
|
|
45
84
|
Key : fileName,
|
|
@@ -163,9 +163,17 @@ export default {
|
|
|
163
163
|
newDom.forEach(doms => {
|
|
164
164
|
doms.style.backgroundColor = this.colors[0];
|
|
165
165
|
})
|
|
166
|
-
|
|
166
|
+
const bodyWrapper = this.$refs.table.$el.querySelector('.el-table__body-wrapper');
|
|
167
|
+
const targetRow = this.$refs.table.$el.querySelector('.setBgClass' + rowId); // 获取目标行元素
|
|
168
|
+
const targetHeight = targetRow.offsetTop; // 目标行的高度(从上到下的距离)
|
|
169
|
+
bodyWrapper.scroll({
|
|
170
|
+
top:targetHeight,
|
|
171
|
+
behavior:"smooth"
|
|
172
|
+
}); // 滚动到目标行位置
|
|
173
|
+
|
|
174
|
+
// newDom[0].scrollIntoView({ behavior: "smooth"})
|
|
167
175
|
}
|
|
168
|
-
},
|
|
176
|
+
},800)
|
|
169
177
|
});
|
|
170
178
|
},
|
|
171
179
|
handleCurrentChange(val){
|