examTools.js 911 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. import {
  2. useUserCache
  3. } from "@/utils/userCache.js"
  4. // 身份确认缓存
  5. const identificationKey = 'ShenFenQueRen'
  6. export function useIdentificationTools() {
  7. const {saveCache,getCache,removeCache} = useUserCache();
  8. function saveIdentCache(key,data) {
  9. saveCache(identificationKey,key, data)
  10. }
  11. function getIdentCache(key) {
  12. return getCache(identificationKey, key)
  13. }
  14. function removeIdentCache(key) {
  15. removeCache(identificationKey,key)
  16. }
  17. return {
  18. saveIdentCache,
  19. getIdentCache,
  20. removeIdentCache
  21. }
  22. }
  23. const ksCache = 'kaoshiCache'
  24. export function useKaoShiCache() {
  25. const {saveCache,getCache,removeCache} = useUserCache();
  26. function saveCacheKs(key,data) {
  27. saveCache(ksCache,key, data)
  28. }
  29. function getCacheKs(key) {
  30. return getCache(ksCache, key)
  31. }
  32. function removeCacheKs(key) {
  33. removeCache(ksCache,key)
  34. }
  35. return {
  36. saveCacheKs,
  37. getCacheKs,
  38. removeCacheKs
  39. }
  40. }