@cloudcare/rum-uniapp 2.1.14 → 2.1.16
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/cjs/boot/buildEnv.js
CHANGED
package/cjs/core/xhrProxy.js
CHANGED
|
@@ -61,27 +61,23 @@ function proxyXhr(userConfiguration) {
|
|
|
61
61
|
dataflux_xhr.startTime = (0, _utils.now)();
|
|
62
62
|
var originalSuccess = arguments[0].success;
|
|
63
63
|
|
|
64
|
-
|
|
65
|
-
arguments[0]
|
|
66
|
-
reportXhr(arguments[0]);
|
|
64
|
+
arguments[0].success = function () {
|
|
65
|
+
reportXhr(arguments[0]);
|
|
67
66
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
67
|
+
if (typeof originalSuccess === 'function') {
|
|
68
|
+
originalSuccess.apply(_this, arguments);
|
|
69
|
+
}
|
|
70
|
+
};
|
|
73
71
|
|
|
74
72
|
var originalFail = arguments[0].fail;
|
|
75
73
|
|
|
76
|
-
|
|
77
|
-
arguments[0]
|
|
78
|
-
reportXhr(arguments[0]);
|
|
74
|
+
arguments[0].fail = function () {
|
|
75
|
+
reportXhr(arguments[0]);
|
|
79
76
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
77
|
+
if (typeof originalFail === 'function') {
|
|
78
|
+
originalFail.apply(_this, arguments);
|
|
79
|
+
}
|
|
80
|
+
};
|
|
85
81
|
|
|
86
82
|
var hasBeenReported = false;
|
|
87
83
|
|
|
@@ -107,7 +103,7 @@ function proxyXhr(userConfiguration) {
|
|
|
107
103
|
var result = originalXhrRequest.call(this, dataflux_xhr.option); // 判断结果是否为promise
|
|
108
104
|
|
|
109
105
|
var isPromise = function isPromise(obj) {
|
|
110
|
-
return !!obj && (_typeof(obj) ===
|
|
106
|
+
return !!obj && (_typeof(obj) === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
|
|
111
107
|
};
|
|
112
108
|
|
|
113
109
|
if (isPromise(result) && userConfiguration.isVue2) {
|
|
@@ -73,7 +73,7 @@ function rewritePage(configuration, lifeCycle, Vue) {
|
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
function newView(lifeCycle, route, startTime) {
|
|
76
|
-
if (typeof startTime === 'undefined') {
|
|
76
|
+
if (typeof startTime === 'undefined' || Number(startTime) === 0) {
|
|
77
77
|
startTime = (0, _utils.now)();
|
|
78
78
|
}
|
|
79
79
|
|
package/esm/boot/buildEnv.js
CHANGED
package/esm/core/xhrProxy.js
CHANGED
|
@@ -46,27 +46,23 @@ function proxyXhr(userConfiguration) {
|
|
|
46
46
|
dataflux_xhr.startTime = now();
|
|
47
47
|
var originalSuccess = arguments[0].success;
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
arguments[0]
|
|
51
|
-
reportXhr(arguments[0]);
|
|
49
|
+
arguments[0].success = function () {
|
|
50
|
+
reportXhr(arguments[0]);
|
|
52
51
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
52
|
+
if (typeof originalSuccess === 'function') {
|
|
53
|
+
originalSuccess.apply(_this, arguments);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
58
56
|
|
|
59
57
|
var originalFail = arguments[0].fail;
|
|
60
58
|
|
|
61
|
-
|
|
62
|
-
arguments[0]
|
|
63
|
-
reportXhr(arguments[0]);
|
|
59
|
+
arguments[0].fail = function () {
|
|
60
|
+
reportXhr(arguments[0]);
|
|
64
61
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
62
|
+
if (typeof originalFail === 'function') {
|
|
63
|
+
originalFail.apply(_this, arguments);
|
|
64
|
+
}
|
|
65
|
+
};
|
|
70
66
|
|
|
71
67
|
var hasBeenReported = false;
|
|
72
68
|
|
|
@@ -92,7 +88,7 @@ function proxyXhr(userConfiguration) {
|
|
|
92
88
|
var result = originalXhrRequest.call(this, dataflux_xhr.option); // 判断结果是否为promise
|
|
93
89
|
|
|
94
90
|
var isPromise = function isPromise(obj) {
|
|
95
|
-
return !!obj && (typeof obj ===
|
|
91
|
+
return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
|
|
96
92
|
};
|
|
97
93
|
|
|
98
94
|
if (isPromise(result) && userConfiguration.isVue2) {
|
|
@@ -61,7 +61,7 @@ export function rewritePage(configuration, lifeCycle, Vue) {
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
function newView(lifeCycle, route, startTime) {
|
|
64
|
-
if (typeof startTime === 'undefined') {
|
|
64
|
+
if (typeof startTime === 'undefined' || Number(startTime) === 0) {
|
|
65
65
|
startTime = now();
|
|
66
66
|
}
|
|
67
67
|
|