zmdms-utils 0.0.44 → 0.0.45
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/es/water.js +7 -0
- package/package.json +1 -1
- package/src/water.ts +7 -1
package/dist/es/water.js
CHANGED
|
@@ -72,6 +72,13 @@ function getDefaultContent() {
|
|
|
72
72
|
if (typeof jwtInfo === "object" && jwtInfo != null) {
|
|
73
73
|
var username = jwtInfo.real_name || jwtInfo.realName || "";
|
|
74
74
|
var phone = jwtInfo.phone || "";
|
|
75
|
+
var phoneLen = phone.length;
|
|
76
|
+
if (phoneLen <= 4) {
|
|
77
|
+
phone = phone;
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
phone = phone.slice(phoneLen - 4);
|
|
81
|
+
}
|
|
75
82
|
var time = dayjs().format("YYMMDD");
|
|
76
83
|
return ["".concat(username, " ").concat(phone), time];
|
|
77
84
|
}
|
package/package.json
CHANGED
package/src/water.ts
CHANGED
|
@@ -78,7 +78,13 @@ export function getDefaultContent() {
|
|
|
78
78
|
const jwtInfo: any = parseToken();
|
|
79
79
|
if (typeof jwtInfo === "object" && jwtInfo != null) {
|
|
80
80
|
const username = jwtInfo.real_name || jwtInfo.realName || "";
|
|
81
|
-
|
|
81
|
+
let phone = jwtInfo.phone || "";
|
|
82
|
+
const phoneLen = phone.length;
|
|
83
|
+
if (phoneLen <= 4) {
|
|
84
|
+
phone = phone;
|
|
85
|
+
} else {
|
|
86
|
+
phone = phone.slice(phoneLen - 4);
|
|
87
|
+
}
|
|
82
88
|
const time = dayjs().format("YYMMDD");
|
|
83
89
|
return [`${username} ${phone}`, time];
|
|
84
90
|
}
|