作为小部件开发人员,我想根据登录 WireCloud 的用户在小部件中显示不同的信息。
小部件如何在加载时确定谁是登录 WireCloud 的用户?
作为小部件开发人员,我想根据登录 WireCloud 的用户在小部件中显示不同的信息。
小部件如何在加载时确定谁是登录 WireCloud 的用户?
WireCloud provides support for accessing context information currently available through the MashupPlatform API. Currently WireCloud provides both the username and the full name of the user:
var username = MashupPlatform.context.get('username');
var realname = MashupPlatform.context.get('fullname');
Take a look into the "3.1.5. Accessing context information" section of the WireCloud's course @ FIWARE Academy for more info about how handle context information from widgets/operators.