回退
This commit is contained in:
14
utils/db.js
14
utils/db.js
@@ -1,5 +1,4 @@
|
||||
import IndexedDBHelper from '@/common/IndexedDBHelper.js'
|
||||
import UniStorageHelper from '@/common/UniStorageHelper.js'
|
||||
import useChatGroupDBStore from '@/stores/userChatGroupStore'
|
||||
import config from '@/config'
|
||||
|
||||
@@ -74,7 +73,7 @@ class BaseStore {
|
||||
// #ifndef H5
|
||||
this.db = new UniStorageHelper(this.dbName, config.DBversion);
|
||||
// #endif
|
||||
|
||||
|
||||
return this.db.openDB([{
|
||||
name: 'record',
|
||||
keyPath: "id",
|
||||
@@ -111,15 +110,8 @@ class BaseStore {
|
||||
}
|
||||
|
||||
async clearDB() {
|
||||
|
||||
|
||||
// #ifdef H5
|
||||
return new IndexedDBHelper().deleteDB(this.dbName);
|
||||
// #endif
|
||||
|
||||
// #ifndef H5
|
||||
return new UniStorageHelper().deleteDB(this.dbName);
|
||||
// #endif
|
||||
// 修正拼写错误并优化 Promise 写法
|
||||
return new IndexedDBHelper().deleteDB(this.dbName);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user