cache.ts 1.2 KB

12345678910111213141516171819202122232425262728293031
  1. /**
  2. * Copyright (c) 2013-Now https://jeesite.com All rights reserved.
  3. * No deletion without permission, or be held responsible to law.
  4. * @author ThinkGem
  5. */
  6. import { defHttp } from '@jeesite/core/utils/http/axios';
  7. import { useGlobSetting } from '@jeesite/core/hooks/setting';
  8. import { BasicModel, Page } from '@jeesite/core/api/model/baseModel';
  9. const { adminPath } = useGlobSetting();
  10. export interface Cache extends BasicModel<Cache> {
  11. cacheName?: string;
  12. key?: string;
  13. value?: any;
  14. }
  15. export const stateCacheNameList = (params?: Cache | any) =>
  16. defHttp.post<Page<Cache>>({ url: adminPath + '/state/cache/cacheNameList', params });
  17. export const stateCacheKeyList = (params?: Cache | any) =>
  18. defHttp.post<Page<Cache>>({ url: adminPath + '/state/cache/cacheKeyList', params });
  19. export const stateCacheValue = (params?: Cache | any) =>
  20. defHttp.post<Page<Cache>>({ url: adminPath + '/state/cache/cacheValue', params });
  21. export const stateCacheClear = (params?: Cache | any) =>
  22. defHttp.get<Cache>({ url: adminPath + '/state/cache/clearCache', params });
  23. export const stateCacheClearAll = (params?: Cache | any) =>
  24. defHttp.get<Cache>({ url: adminPath + '/sys/cache/clearAll', params });