customer-chat-sdk 1.0.59 → 1.0.60
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.
|
@@ -287,7 +287,7 @@ export declare class ScreenshotManager {
|
|
|
287
287
|
private dataUrlToArrayBuffer;
|
|
288
288
|
/**
|
|
289
289
|
* 构建二进制结构(按顺序:sign[14], type[1], topicLength[1], topic[topicLength], routingKey[8])
|
|
290
|
-
*
|
|
290
|
+
* 20 + 1 + 8 + 8 = 37 字节
|
|
291
291
|
*/
|
|
292
292
|
private buildBinaryConfig;
|
|
293
293
|
/**
|
package/dist/customer-sdk.cjs.js
CHANGED
|
@@ -17120,20 +17120,20 @@ class ScreenshotManager {
|
|
|
17120
17120
|
}
|
|
17121
17121
|
/**
|
|
17122
17122
|
* 构建二进制结构(按顺序:sign[14], type[1], topicLength[1], topic[topicLength], routingKey[8])
|
|
17123
|
-
*
|
|
17123
|
+
* 20 + 1 + 8 + 8 = 37 字节
|
|
17124
17124
|
*/
|
|
17125
17125
|
buildBinaryConfig(config) {
|
|
17126
|
-
//
|
|
17127
|
-
const buffer = new ArrayBuffer(
|
|
17126
|
+
// 20 + 1 + 8 + 8 = 37 字节
|
|
17127
|
+
const buffer = new ArrayBuffer(37);
|
|
17128
17128
|
const view = new DataView(buffer);
|
|
17129
17129
|
const encoder = new TextEncoder();
|
|
17130
17130
|
let offset = 0;
|
|
17131
|
-
// sign:
|
|
17131
|
+
// sign: 20字节 (字符串,UTF-8编码,不足补0,大端序)
|
|
17132
17132
|
const signStr = String(config.sign);
|
|
17133
17133
|
const signBytes = encoder.encode(signStr);
|
|
17134
|
-
const signArray = new Uint8Array(buffer, offset,
|
|
17135
|
-
signArray.set(signBytes.slice(0,
|
|
17136
|
-
offset +=
|
|
17134
|
+
const signArray = new Uint8Array(buffer, offset, 20);
|
|
17135
|
+
signArray.set(signBytes.slice(0, 20)); // 截取前20字节,不足自动补0
|
|
17136
|
+
offset += 20;
|
|
17137
17137
|
// type: 1字节
|
|
17138
17138
|
view.setUint8(offset, config.type);
|
|
17139
17139
|
offset += 1;
|
package/dist/customer-sdk.esm.js
CHANGED
|
@@ -17116,20 +17116,20 @@ class ScreenshotManager {
|
|
|
17116
17116
|
}
|
|
17117
17117
|
/**
|
|
17118
17118
|
* 构建二进制结构(按顺序:sign[14], type[1], topicLength[1], topic[topicLength], routingKey[8])
|
|
17119
|
-
*
|
|
17119
|
+
* 20 + 1 + 8 + 8 = 37 字节
|
|
17120
17120
|
*/
|
|
17121
17121
|
buildBinaryConfig(config) {
|
|
17122
|
-
//
|
|
17123
|
-
const buffer = new ArrayBuffer(
|
|
17122
|
+
// 20 + 1 + 8 + 8 = 37 字节
|
|
17123
|
+
const buffer = new ArrayBuffer(37);
|
|
17124
17124
|
const view = new DataView(buffer);
|
|
17125
17125
|
const encoder = new TextEncoder();
|
|
17126
17126
|
let offset = 0;
|
|
17127
|
-
// sign:
|
|
17127
|
+
// sign: 20字节 (字符串,UTF-8编码,不足补0,大端序)
|
|
17128
17128
|
const signStr = String(config.sign);
|
|
17129
17129
|
const signBytes = encoder.encode(signStr);
|
|
17130
|
-
const signArray = new Uint8Array(buffer, offset,
|
|
17131
|
-
signArray.set(signBytes.slice(0,
|
|
17132
|
-
offset +=
|
|
17130
|
+
const signArray = new Uint8Array(buffer, offset, 20);
|
|
17131
|
+
signArray.set(signBytes.slice(0, 20)); // 截取前20字节,不足自动补0
|
|
17132
|
+
offset += 20;
|
|
17133
17133
|
// type: 1字节
|
|
17134
17134
|
view.setUint8(offset, config.type);
|
|
17135
17135
|
offset += 1;
|