db.js 516 字节
Newer Older
B
baiy 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
import {isUtools} from '../helper'
import utoolsDb from '../adapter/utools/db'
import defaultDb from '../adapter/default/db'

const db = isUtools ? utoolsDb : defaultDb;

export default {
    get(key, def = null) {
        return db.get(key, def)
    },
    set(key, value, expiry = 0) {
        return db.set(key, value, expiry)
    },
    remove(key) {
        return db.remove(key)
    },
    // 清理过期
    clear() {
        return db.clear();
    },
    getAllKey() {
        return db.getAllKey();
    }
}