@uxda/appkit 4.3.18 → 4.3.20
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
|
@@ -452,7 +452,8 @@ const defaultLogOptions = {
|
|
|
452
452
|
projectName: "ddyk-dev",
|
|
453
453
|
logStore: "ddjf-internet-web",
|
|
454
454
|
topic: "appkit",
|
|
455
|
-
enable: true
|
|
455
|
+
enable: true,
|
|
456
|
+
enableDebug: false
|
|
456
457
|
};
|
|
457
458
|
function generateUniqueId(pre) {
|
|
458
459
|
return `${pre ? pre + "-" : ""}${Date.now().toString(16)}-${Math.random().toString(36).substr(2)}`;
|
|
@@ -481,6 +482,7 @@ function useLogger(options) {
|
|
|
481
482
|
const baseUrl = `https://${projectName}.cn-shenzhen.log.aliyuncs.com/logstores/${logStore}/track?APIVersion=${APIVersion}`;
|
|
482
483
|
const alislsURL = topic ? `${baseUrl}&__topic__=${topic}` : baseUrl;
|
|
483
484
|
const enable = options.enable === void 0 ? true : options.enable;
|
|
485
|
+
const enableDebug = options.enableDebug === void 0 ? false : options.enableDebug;
|
|
484
486
|
const { miniProgram } = Taro.getEnv() === "WEAPP" ? Taro.getAccountInfoSync() : { miniProgram: { version: "" } };
|
|
485
487
|
const systemInfo = JSON.stringify({
|
|
486
488
|
...getSystemInfoSync(),
|
|
@@ -522,7 +524,9 @@ function useLogger(options) {
|
|
|
522
524
|
current: `${currentPage?.route}?${qs.stringify(taroParams)}`,
|
|
523
525
|
last: lastPage ? `${lastPage?.route}?${qs.stringify(laseTaroParams)}` : ""
|
|
524
526
|
}).slice(0, 1024);
|
|
525
|
-
|
|
527
|
+
if (enableDebug) {
|
|
528
|
+
console.log(params);
|
|
529
|
+
}
|
|
526
530
|
const tmpStr = Object.keys(params).map((key) => `${key}=${encodeURIComponent(params[key])}`).join("&");
|
|
527
531
|
const url2 = `${alislsURL}&${tmpStr}`;
|
|
528
532
|
request$1({ url: url2 });
|
|
@@ -3577,6 +3581,8 @@ var script$E = /* @__PURE__ */ defineComponent({
|
|
|
3577
3581
|
} else {
|
|
3578
3582
|
emit("complete", result);
|
|
3579
3583
|
}
|
|
3584
|
+
}).catch((error) => {
|
|
3585
|
+
state.buttonLoading = false;
|
|
3580
3586
|
});
|
|
3581
3587
|
} else {
|
|
3582
3588
|
wx.login({
|
package/package.json
CHANGED
|
@@ -15,6 +15,7 @@ interface LogType {
|
|
|
15
15
|
alislsURL?: string
|
|
16
16
|
systemInfo?: string
|
|
17
17
|
enable?: boolean
|
|
18
|
+
enableDebug?: boolean
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
const defaultLogOptions: LogType = {
|
|
@@ -22,6 +23,7 @@ const defaultLogOptions: LogType = {
|
|
|
22
23
|
logStore: 'ddjf-internet-web',
|
|
23
24
|
topic: 'appkit',
|
|
24
25
|
enable: true,
|
|
26
|
+
enableDebug: false,
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
// 使用时间戳生成唯一标识
|
|
@@ -56,6 +58,7 @@ export function useLogger(options?: LogType) {
|
|
|
56
58
|
const baseUrl = `https://${projectName}.cn-shenzhen.log.aliyuncs.com/logstores/${logStore}/track?APIVersion=${APIVersion}`
|
|
57
59
|
const alislsURL = topic ? `${baseUrl}&__topic__=${topic}` : baseUrl
|
|
58
60
|
const enable = options.enable === undefined ? true : options.enable
|
|
61
|
+
const enableDebug = options.enableDebug === undefined ? false : options.enableDebug
|
|
59
62
|
|
|
60
63
|
const { miniProgram } =
|
|
61
64
|
Taro.getEnv() === 'WEAPP' ? Taro.getAccountInfoSync() : { miniProgram: { version: '' } }
|
|
@@ -107,7 +110,9 @@ export function useLogger(options?: LogType) {
|
|
|
107
110
|
: '',
|
|
108
111
|
}).slice(0, 1024)
|
|
109
112
|
|
|
110
|
-
|
|
113
|
+
if (enableDebug) {
|
|
114
|
+
console.log(params)
|
|
115
|
+
}
|
|
111
116
|
|
|
112
117
|
const tmpStr = Object.keys(params)
|
|
113
118
|
.map((key) => `${key}=${encodeURIComponent(params[key])}`)
|