libero3 0.3.1 → 0.3.2
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.
|
@@ -27,17 +27,18 @@ function rowToProfile(row) {
|
|
|
27
27
|
updated_at: row.updated_at,
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
-
/** Platform default display_name: e.g. wecom:woqoa1b2xyz → wecom_2xyz
|
|
30
|
+
/** Platform default display_name: e.g. wecom:woqoa1b2xyz → wecom_2xyz。
|
|
31
|
+
* 2026-09-09 修复:短 id(≤8 字符,如 "libero")原样返回——取尾 4 位会截成 "bero"(WorkBuddy 实测)。 */
|
|
31
32
|
export function platformDefaultDisplayName(platformUserId) {
|
|
33
|
+
const tail = (s) => (s.length > 8 ? s.slice(-4) : s);
|
|
32
34
|
const colon = platformUserId.indexOf(":");
|
|
33
35
|
if (colon > 0) {
|
|
34
36
|
const platform = platformUserId.slice(0, colon);
|
|
35
37
|
const rest = platformUserId.slice(colon + 1);
|
|
36
|
-
const suffix = rest
|
|
38
|
+
const suffix = tail(rest) || "user";
|
|
37
39
|
return `${platform}_${suffix}`;
|
|
38
40
|
}
|
|
39
|
-
|
|
40
|
-
return suffix;
|
|
41
|
+
return tail(platformUserId) || "user";
|
|
41
42
|
}
|
|
42
43
|
/**
|
|
43
44
|
* Exact match on display_name.
|