para-bridge-demo
Version:
a bridge api for js-ios/andriod rest
34 lines (31 loc) • 938 B
Markdown
``` tsx
interface IGetWebappCacheParam {
// 客户端统一的项目标志
// projectTag: 'chujing'
projectTag: string;
// 需要获取缓存数据的主键列表
// keys: ['isShowRedPackageTips', 'true']
keys: string[];
}
interface IGetWebappCacheResult {
// 状态 0:不支持 | 1:成功
status: '0' | '1';
// 返回的缓存数据,key为传入的查下主键,value为取到的内容
caches: {
// "isShowRedPackageTips":"true",// isShowRedPackageTips为约定的key,"true"为保存的内容
// "aaaaa":"test"// aaaaa为约定的key,"test"为保存的内容
// 注意key值和value值都是string格式
[index: string]: string;
};
}
private getWebviewCache = () => {
getWebviewCache({
projectTag: 'test_project',
keys: ['key1', 'key2', 'key3', 'undefined'],
}).then(result => {
alert(JSON.stringify(result));
}).catch(e => {
alert(JSON.stringify(e));
});
}
```