@tmsfe/tms-core 0.0.175 → 0.0.176
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/encrypt/index.ts +5 -0
package/package.json
CHANGED
package/src/encrypt/index.ts
CHANGED
|
@@ -117,6 +117,7 @@ function proxyWxRequest(): void {
|
|
|
117
117
|
period: 'receive_data',
|
|
118
118
|
cost: Date.now() - startTime,
|
|
119
119
|
path: originalOptions.url,
|
|
120
|
+
trace_id: traceparent,
|
|
120
121
|
});
|
|
121
122
|
const { header: resHeader, data: resData } = result;
|
|
122
123
|
const { success: decSuccess, msg, res } = await encryptUtil
|
|
@@ -126,6 +127,7 @@ function proxyWxRequest(): void {
|
|
|
126
127
|
period: 'decrypt_data',
|
|
127
128
|
cost: Date.now() - startTime,
|
|
128
129
|
path: originalOptions.url,
|
|
130
|
+
trace_id: traceparent,
|
|
129
131
|
});
|
|
130
132
|
if (res.retry) { // 解密出现问题,需要明文重试
|
|
131
133
|
util.reportFunc(url, traceparent, `解密失败:${msg}`);
|
|
@@ -143,6 +145,7 @@ function proxyWxRequest(): void {
|
|
|
143
145
|
period: 'retry_request',
|
|
144
146
|
cost: Date.now() - startTime,
|
|
145
147
|
path: originalOptions.url,
|
|
148
|
+
trace_id: traceparent,
|
|
146
149
|
});
|
|
147
150
|
},
|
|
148
151
|
header: { ...header, Traceparent: newTraceparent },
|
|
@@ -160,6 +163,7 @@ function proxyWxRequest(): void {
|
|
|
160
163
|
period: 'response_callback',
|
|
161
164
|
cost: Date.now() - startTime,
|
|
162
165
|
path: originalOptions.url,
|
|
166
|
+
trace_id: traceparent,
|
|
163
167
|
});
|
|
164
168
|
} else { // 不支持明文重试,且解密失败
|
|
165
169
|
util.reportFunc(url, traceparent, `解密失败:${msg}`);
|
|
@@ -184,6 +188,7 @@ function proxyWxRequest(): void {
|
|
|
184
188
|
period: 'before_request',
|
|
185
189
|
cost: Date.now() - startTime,
|
|
186
190
|
path: url,
|
|
191
|
+
trace_id: traceparent,
|
|
187
192
|
});
|
|
188
193
|
},
|
|
189
194
|
});
|