From cb091d18530703fad0b28f3826411cc0eab0eb79 Mon Sep 17 00:00:00 2001 From: xingyu Date: Thu, 21 Jul 2022 11:43:57 +0800 Subject: [PATCH] feat: redis api --- .../src/api/infra/redis/index.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/yudao-ui-admin-vue3/src/api/infra/redis/index.ts b/yudao-ui-admin-vue3/src/api/infra/redis/index.ts index 08f0016b6..e9265bd78 100644 --- a/yudao-ui-admin-vue3/src/api/infra/redis/index.ts +++ b/yudao-ui-admin-vue3/src/api/infra/redis/index.ts @@ -23,3 +23,21 @@ export const getKeyListApi = (keyTemplate: string) => { } }) } +// 获取缓存内容 +export const getKeyValue = (key: string) => { + return request.get({ url: '/infra/redis/get-key-value?key=' + key }) +} + +// 根据键名删除缓存 +export const deleteKey = (key: string) => { + return request.delete({ url: '/infra/redis/delete-key?key=' + key }) +} + +export const deleteKeys = (keyTemplate: string) => { + return request.delete({ + url: '/infra/redis/delete-keys?', + params: { + keyTemplate + } + }) +}