feat(imgConfig): 优化图片存储结构
新增uuid依赖用于生成唯一ID,改进图片上传功能中的本地存储结构, 使用uuid替代时间戳作为键名以避免冲突,并调整从indexedDB读取数据的方式。
This commit is contained in:
13
src/utils/localforage/index.ts
Normal file
13
src/utils/localforage/index.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import localforage from 'localforage'
|
||||
|
||||
const imageDbStore = localforage.createInstance({
|
||||
name: 'imgStore',
|
||||
})
|
||||
|
||||
async function clearImageDbStore() {
|
||||
await imageDbStore.clear()
|
||||
}
|
||||
|
||||
export function clearAllDbStore() {
|
||||
clearImageDbStore()
|
||||
}
|
||||
Reference in New Issue
Block a user