Nhảy tới nội dung

clearStorage

Lưu ý

Với API version ﹤ 2.23.0, phải gọi api login trước khi gọi api này và cần xin cấp quyền tại trang Quản lý ứng dụng

Xoá toàn bộ dữ liệu trong cache

Parameters

Object object

PropertyTypeDefaultRequiredDescriptionMinimum Version
successfunctionCallback function khi gọi api thành công
failfunctionCallback function khi gọi api thất bại

Sample Code

import api from 'zmp-sdk';

api.clearStorage({
success: (res) => {
// xử lý khi gọi api thành công
const { key, data } = res;
},
fail: (error) => {
// xử lý khi gọi api thất bại
console.log(error);
}
});

// hoặc
const test = async () => {
try {
await api.clearStorage({});
} catch (error) {
// xử lý khi gọi api thất bại
console.log(error);
}
};