getInfo
Updated at:
Retrieves user information.
Method definition
mpserverless.user.getInfo(): Promise<Result>Return parameters
Field | Type | Description |
|---|---|---|
| Boolean | Indicates whether the operation was successful. |
| Object | User information. |
The user parameter contains the following fields:
Field name | Type | Description |
|---|---|---|
| String | The service space ID. |
| String | The user ID generated by the Serverless platform. |
| String | The user's Alipay, DingTalk, or WeChat identity ID. |
| Number | The timestamp in milliseconds of the user's first log on. |
| Number | The timestamp in milliseconds of the user's last log on. |
Example
After completing the initialization, call the getInfo method.
const { result } = await mpserverless.user.getInfo();
console.log(result)Example output:
{
user: {
createdAt: 1658388913000
lastSeenAt: 1658899909000
oAuthUserId: "2088112127******"
spaceId: "mp-f215973f-****-****-92a8-b09690c7f4ee"
userId: "62d901b15321303781******"
}
}Is this page helpful?