Home > SYS_Environment > getUserInfo
SYS_Environment.getUserInfo() method
获取用户信息
签名
typescript
function getUserInfo(): {
username?: string;
nickname?: string;
avatar?: string;
uuid?: string;
customerCode?: string;
};1
2
3
4
5
6
7
2
3
4
5
6
7
返回值
{ username?: string; nickname?: string; avatar?: string; uuid?: string; customerCode?: string }
用户信息
示例
javascript
// 1. 读取当前用户信息(同步返回对象)
const userInfo = eda.sys_Environment.getUserInfo();
// 2. 输出用户信息(uuid 是账号的唯一标识,可作为业务数据的关联键)
console.log('用户名:', userInfo?.username);
console.log('昵称:', userInfo?.nickname);
console.log('用户 uuid:', userInfo?.uuid);
console.log('客户编号:', userInfo?.customerCode);1
2
3
4
5
6
7
8
2
3
4
5
6
7
8