Module Events
1. User Information Change
Description: This event is triggered when user information changes.
Event: UserEvents.UserInfoChange
Callback Parameters: Object object, detailed type description as follows
| Property | Description | Type |
|---|---|---|
userInfo |
New user information | UserInfoDetail |
Example:
watchCore.user.eventEmitter.on(UserEvents.UserInfoChange, (data) => {
console.log('新的用户信息', data.userInfo);
});
Event: UserEvents.WxMiniUserInfoChange
Callback Parameters: Object object, detailed type description as follows
| Property | Description | Type |
|---|---|---|
wxMiniUserInfo |
- | WxMiniUserInfo |
2. Any User Sets Nickname
Description: This event is triggered after any user sets their nickname.
Event: UserEvents.UserSetNick
Callback Parameters: Object object, detailed type description as follows
| Property | Description | Type |
|---|---|---|
userId |
User userId | string |
nickname |
New nickname | string |
Example:
watchCore.user.eventEmitter.on(UserEvents.UserSetNick, (data) => {
console.log('该用户的 userId', data.userId);
console.log('该用户的新昵称', data.nickname);
});
3. Current User Sets Nickname
Description: This event is triggered after successfully calling user.updateUserNick to change the nickname.
Event: UserEvents.CurrentUserSetNick
Callback Parameters: Object object, detailed type description as follows
| Property | Description | Type |
|---|---|---|
userId |
User userId | string |
nickname |
New nickname | string |
Example:
watchCore.user.eventEmitter.on(UserEvents.CurrentUserSetNick, () => {
toast.success('修改昵称成功');
});
4. Nickname Setting Failed
Description: This event is triggered when calling user.updateUserNick to change the nickname fails.
Event: UserEvents.SetNickError
Callback Parameters: Object object, detailed type description as follows
| Property | Description | Type |
|---|---|---|
message |
Failure information | string |
Example:
watchCore.user.eventEmitter.on(UserEvents.SetNickError, (data) => {
toast.error('修改昵称失败:' + data.message);
});
5. Kick Current Viewer
Event: UserEvents.KickCurrentUser
