企业信息补全接口联调
This commit is contained in:
@@ -111,6 +111,23 @@ class UniStorageHelper {
|
||||
return storeData.filter(item => item[fieldName] === value);
|
||||
}
|
||||
|
||||
async getRecordCount(storeName) {
|
||||
const storeData = this._storageGet(this._getStoreKey(storeName)) || [];
|
||||
return storeData.length;
|
||||
}
|
||||
|
||||
async deleteOldestRecord(storeName) {
|
||||
const storeKey = this._getStoreKey(storeName);
|
||||
const storeData = this._storageGet(storeKey) || [];
|
||||
if (storeData.length > 0) {
|
||||
// 删除第一条记录(最早的记录)
|
||||
const newData = storeData.slice(1);
|
||||
this._storageSet(storeKey, newData);
|
||||
this._log(`删除最早的记录,剩余${newData.length}条记录`);
|
||||
}
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
/*==================
|
||||
更新/删除方法
|
||||
==================*/
|
||||
|
Reference in New Issue
Block a user