my.getAuthCode
Get authentication code.
Sample Code
copy
my.getAuthCode({
scopes: 'auth_user',
success: (res) => {
my.alert({
content: res.authCode,
});
},
});
Parameters
Name | Type | Mandatory | Description |
---|---|---|---|
scopes | String/Array | N | The scope of auth, there are two types: auth_base , auth_user , by default, its value is auth_base |
Success Callback Function
The incoming parameter is of the Object type with the following attributes:
Field | Type | Mandatory | Description |
authCode | String | Y | Auth code |
authErrorScopes | Key-value | Y | The scope that failed to grant auth, key is the scope and value is the error |
authSuccessScopes | Array | Y | The scope that succeed to grant auth |