Commit 5e7e5ad4 by 李伟康

refactor(cache): 重构应用缓存清除模块

- 将 clearAppCache 函数改为默认导出对象的形式
- 更新 App.vue 中的导入方式从命名导入改为默认导入
- 修改调用方式从直接调用函数改为通过对象方法调用
- 保持原有缓存清除功能逻辑不变
1 parent 6cc823a6
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
import { mapState } from 'vuex' import { mapState } from 'vuex'
import { Ws } from '@/ws/Ws.js' import { Ws } from '@/ws/Ws.js'
import { RecordSaveService, UploadService } from '@/utils/recordManager/index.js' import { RecordSaveService, UploadService } from '@/utils/recordManager/index.js'
import { clearAppCache } from '@/utils/clearAppCache.js' import appCacheApi from '@/utils/clearAppCache.js'
export default { export default {
computed: { computed: {
...mapState('audio', ['isEnd', 'isStart']) ...mapState('audio', ['isEnd', 'isStart'])
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
} }
}, },
onShow: async function () { onShow: async function () {
clearAppCache() appCacheApi.clearAppCache()
this.$store.dispatch('setBackgroundState', false) this.$store.dispatch('setBackgroundState', false)
this.$store.dispatch('setActivityWindowPopCount', 1) //冷启动重置活动弹框次数 this.$store.dispatch('setActivityWindowPopCount', 1) //冷启动重置活动弹框次数
// 触发轮询开始事件,通知上传管理重新开始轮询 // 触发轮询开始事件,通知上传管理重新开始轮询
......
export default { const clearAppCache = () => {
clearAppCache () {
// #ifdef APP-PLUS // #ifdef APP-PLUS
try { try {
const currentVersion = plus.runtime.version; const currentVersion = plus.runtime.version;
...@@ -47,4 +46,6 @@ export default { ...@@ -47,4 +46,6 @@ export default {
} }
// #endif // #endif
} }
export default {
clearAppCache
} }
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!