crabatool 1.0.853 → 1.0.855

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": "crabatool",
3
- "version": "1.0.853",
3
+ "version": "1.0.855",
4
4
  "description": "crabatool",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -85,7 +85,7 @@
85
85
  "uglifycss": "^0.0.29",
86
86
  "xml-js": "^1.6.11",
87
87
  "xml-minifier": "^1.0.1",
88
- "qiniu": "^3.1.1"
88
+ "qiniu": "7.15.1"
89
89
  },
90
90
  "repository": {
91
91
  "type": "git",
@@ -48,6 +48,7 @@ function handleEvRecord(conn, message) {
48
48
  var token = message.token;
49
49
  log('收到七牛token:', token ? '已设置' : '空值');
50
50
  evConfig.qiniuToken = token;
51
+ evConfig.qiniuCdnDomain = message.qiniuCdnDomain || 'https://qiniu.wsgjp.cn/';
51
52
  if (token) {
52
53
  sendEvMessage(conn, 'msg', '七牛token已设置,请开始录制音视频;录制完成会自动上传七牛,并自动关联当前教学步骤。');
53
54
  } else {
@@ -315,16 +316,17 @@ function processEvFile(conn, filePath) {
315
316
  sendEvMessage(conn, 'error', '上传失败: ' + respErr.message);
316
317
  } else {
317
318
  if (respInfo.statusCode == 200) {
319
+ // console.log(respInfo, respBody);
318
320
  // 构建文件URL - 使用配置的CDN域名或从上传结果获取
319
- var cdnDomain = config.qiniuCdnDomain || 'https://cdn.example.com';
320
- var audioUrl = cdnDomain + '/' + respBody.key;
321
+ var cdnDomain = evConfig.qiniuCdnDomain;
322
+ if (!cdnDomain.endsWith('/')) {
323
+ cdnDomain = cdnDomain + '/';
324
+ }
325
+ var audioUrl = cdnDomain + respBody.key;
321
326
  log('上传成功:', filePath, '->', audioUrl);
322
327
 
323
328
  // 发送文件URL给前端,包含文件类型
324
- sendEvMessage(conn, 'completed', '录制完成', {
325
- audioUrl: audioUrl,
326
- fileType: fileType
327
- });
329
+ sendEvMessage(conn, 'completed', '录制完成', { audioUrl: audioUrl, fileType: fileType });
328
330
  } else {
329
331
  log('上传失败,状态码:', respInfo.statusCode);
330
332
  sendEvMessage(conn, 'error', '上传失败: ' + respInfo.statusCode);