Skip to content

获取值


get()

获取存储在给定键中的值,需要传入一个键名。RDb() 需要传入一个数据源配置

const redisConfig = {
    host: '127.0.0.1',
    port: 6379,
    db: 0
}
const redisConfig = {
    host: '127.0.0.1',
    port: 6379,
    db: 0
}
  • @param key
  • (key: string)

get()

import { RDb } from 'think-ts-db'
export default defineEventHandler(async (event) => {
    const token = await RDb(redisConfig).get('token')
    return token
})
import { RDb } from 'think-ts-db'
export default defineEventHandler(async (event) => {
    const token = await RDb(redisConfig).get('token')
    return token
})

备案号:冀ICP备20015584号-2