@uxda/appkit 4.2.98 → 4.3.1

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/dist/index.js CHANGED
@@ -8,6 +8,7 @@ import Taro, { showModal, getSystemInfoSync, getMenuButtonBoundingClientRect, up
8
8
  import '@nutui/nutui-taro/dist/packages/popup/style/css';
9
9
  import isMobilePhone from 'validator/es/lib/isMobilePhone';
10
10
  import isIdentityCard from 'validator/es/lib/isIdentityCard';
11
+ import qs from 'qs';
11
12
  import { NsForm, NsInput, NsButton, NsIcon, usePopup, useNutshell, NsButtonGroup, usePaging, NsPage, NsTabs, NsTabsItem, NsPageContent, NsSkeleton, NsRepeator, NsCard, NsEmpty, NsCheckbox } from '@uxda/nutshell/taro';
12
13
  import '@nutui/nutui-taro/dist/packages/actionsheet/style/css';
13
14
  import pako from 'pako';
@@ -474,9 +475,19 @@ function useLogger(options) {
474
475
  const pages = Taro.getCurrentPages();
475
476
  const currentPage = pages?.[pages.length - 1];
476
477
  const lastPage = pages?.[pages.length - 2];
478
+ const taroParams = currentPage.$taroParams;
479
+ if (taroParams) {
480
+ delete taroParams.stamp;
481
+ delete taroParams.$taroTimestamp;
482
+ }
483
+ const laseTaroParams = lastPage?.$taroParams;
484
+ if (laseTaroParams) {
485
+ delete laseTaroParams.stamp;
486
+ delete laseTaroParams.$taroTimestamp;
487
+ }
477
488
  params.pages = JSON.stringify({
478
- current: currentPage?.$taroPath,
479
- last: lastPage?.$taroPath
489
+ current: `${currentPage?.route}?${qs.stringify(taroParams)}`,
490
+ last: lastPage ? `${lastPage?.route}?${qs.stringify(laseTaroParams)}` : ""
480
491
  }).slice(0, 1024);
481
492
  console.log(params);
482
493
  const tmpStr = Object.keys(params).map((key) => `${key}=${encodeURIComponent(params[key])}`).join("&");
@@ -986,6 +997,12 @@ const vendor$3 = {
986
997
  traceId: generateUniqueId("appkit")
987
998
  };
988
999
  const startTime = (/* @__PURE__ */ new Date()).getTime();
1000
+ logger$3.info({
1001
+ send: JSON.stringify({ url: config.url, data: config.data }),
1002
+ receive: null,
1003
+ traceId: header.traceId,
1004
+ duration: 0
1005
+ });
989
1006
  request$1({
990
1007
  url: config.url,
991
1008
  method: config.method,
@@ -2717,6 +2734,12 @@ const vendor$2 = {
2717
2734
  traceId: generateUniqueId("appkit")
2718
2735
  };
2719
2736
  const startTime = (/* @__PURE__ */ new Date()).getTime();
2737
+ logger$2.info({
2738
+ send: JSON.stringify({ url: config.url, data: config.data }),
2739
+ receive: null,
2740
+ traceId: header.traceId,
2741
+ duration: 0
2742
+ });
2720
2743
  request$1({
2721
2744
  url: config.url,
2722
2745
  method: config.method,
@@ -6321,6 +6344,12 @@ const vendor$1 = {
6321
6344
  traceId: generateUniqueId("appkit")
6322
6345
  };
6323
6346
  const startTime = (/* @__PURE__ */ new Date()).getTime();
6347
+ logger$1.info({
6348
+ send: JSON.stringify({ url: config.url, data: config.data }),
6349
+ receive: null,
6350
+ traceId: header.traceId,
6351
+ duration: 0
6352
+ });
6324
6353
  request$1({
6325
6354
  url: config.url,
6326
6355
  method: config.method,
@@ -7700,6 +7729,12 @@ const vendor = {
7700
7729
  traceId: generateUniqueId("appkit")
7701
7730
  };
7702
7731
  const startTime = (/* @__PURE__ */ new Date()).getTime();
7732
+ logger.info({
7733
+ send: JSON.stringify({ url: config.url, data: config.data }),
7734
+ receive: null,
7735
+ traceId: header.traceId,
7736
+ duration: 0
7737
+ });
7703
7738
  request$1({
7704
7739
  url: config.url,
7705
7740
  method: config.method,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxda/appkit",
3
- "version": "4.2.98",
3
+ "version": "4.3.1",
4
4
  "description": "小程序应用开发包",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.ts",
@@ -18,6 +18,12 @@ const vendor = {
18
18
  }
19
19
  const startTime = new Date().getTime()
20
20
 
21
+ logger.info({
22
+ send: JSON.stringify({ url: config.url, data: config.data }),
23
+ receive: null,
24
+ traceId: header.traceId,
25
+ duration: 0,
26
+ })
21
27
  TaroRequest({
22
28
  url: config.url,
23
29
  method: config.method,
@@ -18,6 +18,12 @@ const vendor = {
18
18
  }
19
19
  const startTime = new Date().getTime()
20
20
 
21
+ logger.info({
22
+ send: JSON.stringify({ url: config.url, data: config.data }),
23
+ receive: null,
24
+ traceId: header.traceId,
25
+ duration: 0,
26
+ })
21
27
  TaroRequest({
22
28
  url: config.url,
23
29
  method: config.method,
@@ -18,6 +18,12 @@ const vendor = {
18
18
  }
19
19
  const startTime = new Date().getTime()
20
20
 
21
+ logger.info({
22
+ send: JSON.stringify({ url: config.url, data: config.data }),
23
+ receive: null,
24
+ traceId: header.traceId,
25
+ duration: 0,
26
+ })
21
27
  TaroRequest({
22
28
  url: config.url,
23
29
  method: config.method,
@@ -2,6 +2,7 @@
2
2
  * 记录阿里日志
3
3
  * 生产: https://sls.console.aliyun.com/lognext/project/ddyk-prod/logsearch/ddjf-internet-web
4
4
  */
5
+ import qs from 'qs'
5
6
  import { useAppKitOptions } from '../../Appkit'
6
7
  import Taro, { getSystemInfoSync, request } from '@tarojs/taro'
7
8
 
@@ -89,9 +90,21 @@ export function useLogger(options?: LogType) {
89
90
  const pages = Taro.getCurrentPages()
90
91
  const currentPage = pages?.[pages.length - 1]
91
92
  const lastPage = pages?.[pages.length - 2]
93
+ const taroParams = currentPage.$taroParams
94
+ if (taroParams) {
95
+ delete taroParams.stamp
96
+ delete taroParams.$taroTimestamp
97
+ }
98
+ const laseTaroParams = lastPage?.$taroParams
99
+ if (laseTaroParams) {
100
+ delete laseTaroParams.stamp
101
+ delete laseTaroParams.$taroTimestamp
102
+ }
92
103
  params.pages = JSON.stringify({
93
- current: currentPage?.$taroPath,
94
- last: lastPage?.$taroPath,
104
+ current: `${currentPage?.route}?${qs.stringify(taroParams)}`,
105
+ last: lastPage
106
+ ? `${lastPage?.route}?${qs.stringify(laseTaroParams)}`
107
+ : '',
95
108
  }).slice(0, 1024)
96
109
 
97
110
  console.log(params)
@@ -18,6 +18,12 @@ const vendor = {
18
18
  }
19
19
  const startTime = new Date().getTime()
20
20
 
21
+ logger.info({
22
+ send: JSON.stringify({ url: config.url, data: config.data }),
23
+ receive: null,
24
+ traceId: header.traceId,
25
+ duration: 0,
26
+ })
21
27
  TaroRequest({
22
28
  url: config.url,
23
29
  method: config.method,