Files
ipms-sjy/yudao-ui-admin-vue3/src/api/infra/redis/index.ts

44 lines
994 B
TypeScript
Raw Normal View History

2022-07-19 22:33:54 +08:00
import { useAxios } from '@/hooks/web/useAxios'
const request = useAxios()
2022-07-18 19:06:37 +08:00
/**
* redis
*/
2022-07-19 22:33:54 +08:00
export const getCacheApi = () => {
return request.get({ url: '/infra/redis/get-monitor-info' })
}
// 获取模块
export const getKeyDefineListApi = () => {
return request.get({ url: '/infra/redis/get-key-define-list' })
2022-07-18 19:06:37 +08:00
}
/**
* redis key列表
*/
2022-07-19 22:33:54 +08:00
export const getKeyListApi = (keyTemplate: string) => {
return request.get({
url: '/infra/redis/get-key-list',
params: {
keyTemplate
}
})
2022-07-18 19:06:37 +08:00
}
2022-07-21 11:43:57 +08:00
// 获取缓存内容
export const getKeyValueApi = (key: string) => {
2022-07-21 11:43:57 +08:00
return request.get({ url: '/infra/redis/get-key-value?key=' + key })
}
// 根据键名删除缓存
export const deleteKeyApi = (key: string) => {
2022-07-21 11:43:57 +08:00
return request.delete({ url: '/infra/redis/delete-key?key=' + key })
}
export const deleteKeysApi = (keyTemplate: string) => {
2022-07-21 11:43:57 +08:00
return request.delete({
url: '/infra/redis/delete-keys?',
params: {
keyTemplate
}
})
}