@conecli/cone-render 0.8.20-shop.185 → 0.8.20-shop.186

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.
@@ -1 +1 @@
1
- export const HttpStatus = {
2
1
  SUCCESS: 200,
3
2
  CREATED: 201,
4
3
  ACCEPTED: 202,
5
4
  CLIENT_ERROR: 400,
6
5
  AUTHENTICATE: 401,
7
6
  FORBIDDEN: 403,
8
7
  NOT_FOUND: 404,
9
8
  SERVER_ERROR: 500,
10
9
  BAD_GATEWAY: 502,
11
10
  SERVICE_UNAVAILABLE: 503,
12
11
  GATEWAY_TIMEOUT: 504,
13
12
  [HttpStatus.NOT_FOUND]: '请求资源不存在',
14
13
  [HttpStatus.BAD_GATEWAY]: '服务端异常,请稍后重试',
15
14
  [HttpStatus.FORBIDDEN]: '没有权限访问',
16
15
  [HttpStatus.AUTHENTICATE]: '需要鉴权',
17
16
  [HttpStatus.SUCCESS]: '成功',
18
17
  'whx_getShopHomeFloorInfo',
19
18
  'whx_searchWare',
20
19
  'shopGuessYouLike',
21
20
  'whx_getMShopCategory',
22
21
  'whx_newWareList',
23
22
  'getShopHomePromotionWebPage',
24
23
  'whx_getShopCampaignPage',
25
24
  'whx_getPromotionWares',
26
25
  'whx_buyerShowPage',
27
26
  'whx_getShopGwredPage',
28
27
  'whx_getShopSpeciSecKillPage',
29
28
  'whx_getSignInfo',
30
29
  'whx_getSignPrize',
31
30
  'getShopHomeFloorInfo',
32
31
  'shopGuessYouLike',
33
32
  'getShopHomePromotionWebPage',
34
33
  'getVipDetail',
35
34
  'getShopCategory',
36
35
  'getShopNavigationCategory',
37
36
  'getPagePreview',
38
37
  'bmall_cart',
39
38
  'bmall_getOmittedProduct',
40
39
  'bmall_cartAdd',
41
40
  'bmall_cartChange',
42
41
  'bmall_cartRemove',
43
42
  'whx_getShopHomeFloorInfo',
44
43
  'whx_searchWare',
45
44
  'shopGuessYouLike',
46
45
  'whx_getMShopCategory',
47
46
  'whx_newWareList',
48
47
  'getShopHomePromotionWebPage',
49
48
  'whx_getShopCampaignPage',
50
49
  'whx_getPromotionWares',
51
50
  'whx_buyerShowPage',
52
51
  'getShopHomeFloorInfo',
53
52
  'getShopCategory',
54
53
  'getShopNavigationCategory',
55
54
  'giftCardAddCart',
56
55
  'receiveShopCoupon',
57
56
  'getShopHomePromotionWebPage',
58
57
  'shopGuessYouLike',
59
58
  'addRemind',
60
59
  'cancelRemind',
61
60
  'getVipDetail',
62
61
  'shopDetail',
63
62
  'address_queryAddress',
64
63
  'shopMemberSprintJoinActivity',
65
64
  'shopMemberSprintReceivePrize',
66
65
  'bmall_cart',
67
66
  'bmall_getOmittedProduct',
68
67
  'bmall_cartAdd',
69
68
  'bmall_cartChange',
70
69
  'bmall_cartRemove',
71
70
  SHOP_COLOR_APPID: 'shop_m_jd_com',
72
71
  JSHOPX_COLOR_APPID: 'jshopx_jd_com',
73
72
  PAGES_COLOR_APPID: 'pages_jd_com',
74
73
  B2B_COLOR_APPID: 'b2b',
75
74
  SHOP_MEMBER_COLOR_APPID: 'shopmember_m_jd_com',
76
75
  MALL_COLOR_APPID: 'mall_jd_com',
77
76
  'getSeriesTabData',
78
77
  'searchWare',
79
78
  'getDrShopDiscoveryFeeds',
79
+ export const HttpStatus = {
80
80
  SUCCESS: 200,
81
81
  CREATED: 201,
82
82
  ACCEPTED: 202,
83
83
  CLIENT_ERROR: 400,
84
84
  AUTHENTICATE: 401,
85
85
  FORBIDDEN: 403,
86
86
  NOT_FOUND: 404,
87
87
  SERVER_ERROR: 500,
88
88
  BAD_GATEWAY: 502,
89
89
  SERVICE_UNAVAILABLE: 503,
90
90
  GATEWAY_TIMEOUT: 504,
91
91
  [HttpStatus.NOT_FOUND]: '请求资源不存在',
92
92
  [HttpStatus.BAD_GATEWAY]: '服务端异常,请稍后重试',
93
93
  [HttpStatus.FORBIDDEN]: '没有权限访问',
94
94
  [HttpStatus.AUTHENTICATE]: '需要鉴权',
95
95
  [HttpStatus.SUCCESS]: '成功',
96
96
  'whx_getShopHomeFloorInfo',
97
97
  'whx_searchWare',
98
98
  'shopGuessYouLike',
99
99
  'whx_getMShopCategory',
100
100
  'whx_newWareList',
101
101
  'getShopHomePromotionWebPage',
102
102
  'whx_getShopCampaignPage',
103
103
  'whx_getPromotionWares',
104
104
  'whx_buyerShowPage',
105
105
  'whx_getShopGwredPage',
106
106
  'whx_getShopSpeciSecKillPage',
107
107
  'whx_getSignInfo',
108
108
  'whx_getSignPrize',
109
109
  'getShopHomeFloorInfo',
110
110
  'shopGuessYouLike',
111
111
  'getShopHomePromotionWebPage',
112
112
  'getVipDetail',
113
113
  'getShopCategory',
114
114
  'getShopNavigationCategory',
115
115
  'colorApiPreview',
116
116
  'bmall_cart',
117
117
  'bmall_getOmittedProduct',
118
118
  'bmall_cartAdd',
119
119
  'bmall_cartChange',
120
120
  'bmall_cartRemove',
121
121
  'whx_getShopHomeFloorInfo',
122
122
  'whx_searchWare',
123
123
  'shopGuessYouLike',
124
124
  'whx_getMShopCategory',
125
125
  'whx_newWareList',
126
126
  'getShopHomePromotionWebPage',
127
127
  'whx_getShopCampaignPage',
128
128
  'whx_getPromotionWares',
129
129
  'whx_buyerShowPage',
130
130
  'getShopHomeFloorInfo',
131
131
  'getShopCategory',
132
132
  'getShopNavigationCategory',
133
133
  'giftCardAddCart',
134
134
  'receiveShopCoupon',
135
135
  'getShopHomePromotionWebPage',
136
136
  'shopGuessYouLike',
137
137
  'addRemind',
138
138
  'cancelRemind',
139
139
  'getVipDetail',
140
140
  'shopDetail',
141
141
  'address_queryAddress',
142
142
  'shopMemberSprintJoinActivity',
143
143
  'shopMemberSprintReceivePrize',
144
144
  'bmall_cart',
145
145
  'bmall_getOmittedProduct',
146
146
  'bmall_cartAdd',
147
147
  'bmall_cartChange',
148
148
  'bmall_cartRemove',
149
149
  SHOP_COLOR_APPID: 'shop_m_jd_com',
150
150
  JSHOPX_COLOR_APPID: 'jshopx_jd_com',
151
151
  PAGES_COLOR_APPID: 'pages_jd_com',
152
152
  B2B_COLOR_APPID: 'b2b',
153
153
  SHOP_MEMBER_COLOR_APPID: 'shopmember_m_jd_com',
154
154
  MALL_COLOR_APPID: 'mall_jd_com',
155
155
  'getSeriesTabData',
156
156
  'searchWare',
157
157
  'getDrShopDiscoveryFeeds',
@@ -1 +1 @@
1
- const colorDSM = 'https://api.m.jd.com/client.action?functionId=';
2
1
  [
3
2
  colorDSM + 'op_getGoodListByCatesIds',
4
3
  ['dsm.jshop.operations.api.inner.service.ProductJsfService.getGoodListByCatesIds', true],
5
4
  ,
6
5
  ],
7
6
  console.log('getSColorPara ~ url is:', url);
8
7
  url = colorDSM + url;
9
8
  if (isDowngradeSDM(url)) {
10
9
  return {};
11
10
  }
12
11
  return getDSMValue(url)
13
12
  ? {
14
13
  url: '/api?v=1.0&appId=IEAFE4HKEFPYCKVAUVBR&api=' + getDSMValue(url)[0],
15
14
  }
16
15
  : {};
17
16
  url = colorDSM + url;
18
17
  try {
19
18
  if (isDowngradeSDM(url)) {
20
19
  return false;
21
20
  }
22
21
  console.log('is DSM', !!getDSMValue(url));
23
22
  return !!getDSMValue(url);
24
23
  } catch (error) {
25
24
  console.log('🚀 ~ checkIsDSM ~ error:', error);
26
25
  return false;
27
26
  }
28
27
  url = colorDSM + url;
29
28
  if (isDowngradeSDM(url)) {
30
29
  return false;
31
30
  }
32
31
  console.log('is need deconstruction', getDSMValue(url) ? getDSMValue(url)[1] : false);
33
32
  return getDSMValue(url) ? getDSMValue(url)[1] : false;
34
33
  for (let [key, value] of DSM) {
35
34
  if (url.startsWith(key) && url.includes('?')) {
36
35
  return value;
37
36
  }
38
37
  if (key === url) {
39
38
  return value;
40
39
  }
41
40
  }
42
41
  return '';
43
42
  const { nodePageData } = window;
44
43
  const { DSMDowngradeList } = nodePageData;
45
44
  console.log('DSMDowngradeList:', DSMDowngradeList);
46
45
  if (
47
46
  !Array.isArray(DSMDowngradeList) ||
48
47
  (DSMDowngradeList.length > 0 &&
49
48
  DSMDowngradeList.some((prefix) => url.startsWith(prefix)) &&
50
49
  url.includes('?')) ||
51
50
  DSMDowngradeList.includes(url)
52
51
  ) {
53
52
  return true;
54
53
  }
55
54
  return false;
56
55
  getSColorPara: (url) => getSColorPara(url),
57
56
  checkIsNeedDeconstruction: (url) => checkIsNeedDeconstruction(url),
58
57
  checkIsDSM: (url) => checkIsDSM(url),
58
+ const colorDSM = 'https://api.m.jd.com/client.action?functionId=';
59
59
  [
60
60
  colorDSM + 'op_getGoodListByCatesIds',
61
61
  ['dsm.jshop.operations.api.inner.service.ProductJsfService.getGoodListByCatesIds', true],
62
62
  ,
63
63
  ],
64
64
  console.log('getSColorPara ~ url is:', url);
65
65
  url = colorDSM + url;
66
66
  if (isDowngradeSDM(url)) {
67
67
  return {};
68
68
  }
69
69
  return getDSMValue(url)
70
70
  ? {
71
71
  url: '/api?v=1.0&appId=IEAFE4HKEFPYCKVAUVBR&api=' + getDSMValue(url)[0],
72
72
  }
73
73
  : {};
74
74
  url = colorDSM + url;
75
75
  try {
76
76
  if (isDowngradeSDM(url)) {
77
77
  return false;
78
78
  }
79
79
  console.log('is DSM', !!getDSMValue(url));
80
80
  return !!getDSMValue(url);
81
81
  } catch (error) {
82
82
  console.log('🚀 ~ checkIsDSM ~ error:', error);
83
83
  return false;
84
84
  }
85
85
  url = colorDSM + url;
86
86
  if (isDowngradeSDM(url)) {
87
87
  return false;
88
88
  }
89
89
  console.log('is need deconstruction', getDSMValue(url) ? getDSMValue(url)[1] : false);
90
90
  return getDSMValue(url) ? getDSMValue(url)[1] : false;
91
91
  for (let [key, value] of DSM) {
92
92
  if (url.startsWith(key) && url.includes('?')) {
93
93
  return value;
94
94
  }
95
95
  if (key === url) {
96
96
  return value;
97
97
  }
98
98
  }
99
99
  return '';
100
100
  const { nodePageData } = window;
101
101
  const { DSMDowngradeList = null, routeBlackList = null } = nodePageData;
102
102
  if (
103
103
  nodePageData &&
104
104
  routeBlackList &&
105
105
  Array.isArray(routeBlackList) &&
106
106
  ((routeBlackList.length > 0 &&
107
107
  routeBlackList.some((prefix) => url.startsWith(prefix)) &&
108
108
  url.includes('?')) ||
109
109
  routeBlackList.includes(url))
110
110
  ) {
111
111
  return true;
112
112
  }
113
113
  if (DSMDowngradeList === null) return true;
114
114
  if (
115
115
  !Array.isArray(DSMDowngradeList) ||
116
116
  (DSMDowngradeList.length > 0 &&
117
117
  DSMDowngradeList.some((prefix) => url.startsWith(prefix)) &&
118
118
  url.includes('?')) ||
119
119
  DSMDowngradeList.includes(url)
120
120
  ) {
121
121
  return true;
122
122
  }
123
123
  return false;
124
124
  getSColorPara: (url) => getSColorPara(url),
125
125
  checkIsNeedDeconstruction: (url) => checkIsNeedDeconstruction(url),
126
126
  checkIsDSM: (url) => checkIsDSM(url),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@conecli/cone-render",
3
- "version": "0.8.20-shop.185",
3
+ "version": "0.8.20-shop.186",
4
4
  "private": false,
5
5
  "files": [
6
6
  "dist/"