在前端脚本中,可以通过this.session.user来获取当前用户信息。
Syntax
var user = this.session.user;
Returns
-
Object
当前用户信息,内容和格式如下:
{ "id": "267a7bcc-f27a-49c8-8364-f1c12061085a", //人员ID "genderType": "m", //性别 "icon": "...", //头像 "signature": "", //个人签名 "name": "张三", //姓名 "employee": "zhansan", //员工号 "unique": "zhansan", //唯一标识 "distinguishedName": "xx@zhansan@P", //人员全称 "superior": "", //上级人员id "changePasswordTime": "2017-03-13", //修改密码时间 "lastLoginTime": "2019-01-02", //最后登录时间 "mail": "zhansan@zoneland.net", //邮件地址 "weixin": "", //微信号 "qq": "", //QQ "mobile": "18057190078", //手机号码 "officePhone": "", //办公电话 "createTime": "2017-03-13 12:27:04", //人员创建时间 "updateTime": "2019-01-02 13:00:04", //人员修改时间 "token": "...", //当前用户token "roleList": [ //人员角色 "ProcessPlatformCreator@ProcessPlatformCreatorSystemRole@R", "ProcessPlatformManager@ProcessPlatformManagerSystemRole@R", "Manager@ManagerSystemRole@R" ], "identityList": [ //人员身份列表 { "id": "709328c8-44a0-4f5d-a3fa-3c31208232d5", //身份ID "name": "xx", //身份名称 "unique": "709328c8-44a0-4f5d-a3fa-3c31208232d5", //身份唯一标识 "distinguishedName": "xx@709328c8-44a0-4f5d-a3fa-3c31208232d5@I", //身份全称 "person": "267a7bcc-f27a-49c8-8364-f1c12061085a", //人员ID "unit": "d5356fd4-6675-45ad-9a00-5eff20b83dfa", //所属组织ID "unitName": "开发部", //所属组织名称 "unitLevel": 2, //所属组织层级 "unitLevelName": "兰德纵横/开发部", //所属组织层次名 "major": true //是否是主身份 }, { "id": "343510af-57c2-4a55-a1f2-f30d7af6d284", "description": "", "name": "xx", "unique": "343510af-57c2-4a55-a1f2-f30d7af6d284", "distinguishedName": "xx@343510af-57c2-4a55-a1f2-f30d7af6d284@I", "person": "267a7bcc-f27a-49c8-8364-f1c12061085a", "unit": "108b1b7c-cc78-49ab-9ab1-e67073bd6541", "unitName": "开发部", "unitLevel": 2, "unitLevelName": "浙江兰德纵横/开发部", "major": false } ] }
Example
//获取当前用户信息
var user = this.session.user