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 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zmdms-utils",
3
- "version": "0.0.44",
3
+ "version": "0.0.45",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
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
- const phone = jwtInfo.phone || "";
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
  }