@tmsfe/tms-core 0.0.189 → 0.0.190

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/request.js +3 -9
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tmsfe/tms-core",
3
- "version": "0.0.189",
3
+ "version": "0.0.190",
4
4
  "description": "tms运行时框架",
5
5
  "repository": {
6
6
  "type": "git",
package/src/request.js CHANGED
@@ -17,13 +17,6 @@ import logger from './logger';
17
17
 
18
18
  const RETRY_WX_ERR_NOS = [600001, 600003, 5]; // 微信底层错误重试码 600001-微信cronet组件错误 600003-网络中断 5-接口超时
19
19
 
20
- // 重试api白名单
21
- const RETRY_API_WHITE_LIST = [
22
- 'marketing/apollo/config',
23
- 'user/pubsubscribe/get',
24
- 'marketing/config',
25
- ];
26
-
27
20
  /**
28
21
  * 用于序列化需要签名的参数
29
22
  * @private
@@ -396,9 +389,10 @@ export default class Request {
396
389
  return res;
397
390
  } catch (err) {
398
391
  // 微信系统errno:在重试码白名单内,重试
399
- const isWhiteApi = RETRY_API_WHITE_LIST.includes(path);
392
+ const { retryFlag, retryApiWhiteMap } = wx.tmsFlagMap || {};
393
+ const isWhiteApi = retryApiWhiteMap?.home === 'all' ? true : (retryApiWhiteMap?.home || []).includes(path);
400
394
  const canRetry = errno => RETRY_WX_ERR_NOS.includes(errno) && isWhiteApi;
401
- if (canRetry(err?.errno) && wx.tmsFlagMap?.retryFlag) {
395
+ if (retryFlag && canRetry(err?.errno)) {
402
396
  return await this.handleReTry(path, param, method, header, {
403
397
  reportMsg: {
404
398
  errno: err.errno,