@xuda.io/account_module 1.2.161 → 1.2.163
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/index.mjs +18 -0
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1482,3 +1482,21 @@ export const get_account_default_project_id = async function (uid) {
|
|
|
1482
1482
|
|
|
1483
1483
|
// // console.log(await get_contact({ uid, name: "bo" }));
|
|
1484
1484
|
// }, 2000);
|
|
1485
|
+
|
|
1486
|
+
export const get_user_name = async function (uid) {
|
|
1487
|
+
try {
|
|
1488
|
+
const account_info = await get_account_name(uid);
|
|
1489
|
+
let username = 'unknown';
|
|
1490
|
+
if (account_info) {
|
|
1491
|
+
username = account_info.first_name + ' ' + account_info.last_name;
|
|
1492
|
+
|
|
1493
|
+
if (!username) {
|
|
1494
|
+
username = +account_info.email;
|
|
1495
|
+
}
|
|
1496
|
+
}
|
|
1497
|
+
|
|
1498
|
+
return username;
|
|
1499
|
+
} catch (err) {
|
|
1500
|
+
return 'unknown';
|
|
1501
|
+
}
|
|
1502
|
+
};
|