getAccessToken
Lấy thông tin xác thực user.
Parameters
Object object
Property | Type | Default | Required | Description | Minimum Version |
---|---|---|---|---|---|
success | function | Callback function khi gọi api thành công | |||
fail | function | Callback function khi gọi api thất bại |
Return Values
Promise<string accessToken>
Sample Code
import { getAccessToken } from 'zmp-sdk/apis';
success: () => {
// xử lý khi gọi api thành công
getAccessToken({
success: (accessToken) => {
// xử lý khi gọi api thành công
},
fail: (error) => {
// xử lý khi gọi api thất bại
console.log(error);
}
});
},
fail: (error) => {
// xử lý khi gọi api thất bại
console.log(error);
}
// hoặc
const test = async () => {
try {
const accessToken = await getAccessToken({});
} catch (error) {
// xử lý khi gọi api thất bại
console.log(error);
}
}