|
|
@@ -30,7 +30,7 @@ export function useIdentificationTools() {
|
|
|
|
|
|
const ksCache = 'kaoshiCache'
|
|
|
export function useKaoShiCache() {
|
|
|
- const {saveCache,getCache,removeCache} = useUserCache();
|
|
|
+ const {saveCache,getCache,removeCache,getCacheOtherNotKey} = useUserCache();
|
|
|
|
|
|
function saveCacheKs(key,data) {
|
|
|
saveCache(ksCache,key, data)
|
|
|
@@ -45,9 +45,20 @@ export function useKaoShiCache() {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ // 清理考试缓存其他,保留目标缓存 务必使考试缓存保持唯一
|
|
|
+ function removeCacheKsOther(key) {
|
|
|
+ const data = getCacheOtherNotKey(ksCache)
|
|
|
+ if (data) {
|
|
|
+ const newData = data[key];
|
|
|
+ saveCache(ksCache, key, newData)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
return {
|
|
|
saveCacheKs,
|
|
|
getCacheKs,
|
|
|
- removeCacheKs
|
|
|
+ removeCacheKs,
|
|
|
+ removeCacheKsOther
|
|
|
}
|
|
|
}
|