清缓存
This commit is contained in:
parent
15baf12899
commit
1365c942da
|
@ -29,6 +29,7 @@ const { safeAreaInsets } = uni.getSystemInfoSync()
|
|||
const contentData = reactive<any>({})
|
||||
const query = ref<string>('')
|
||||
const useStore = useUserStore()
|
||||
let timer = null
|
||||
|
||||
interface SrcListType {
|
||||
url?: string
|
||||
|
@ -116,6 +117,15 @@ const initContent = async () => {
|
|||
}
|
||||
|
||||
onLoad(() => {
|
||||
timer = setInterval(async () => {
|
||||
const params = {
|
||||
activity_code: query.value || '',
|
||||
}
|
||||
const res: any = await getContent(params)
|
||||
if (JSON.stringify(res.data) !== JSON.stringify(useStore.userInfo.contentData)) {
|
||||
initContent()
|
||||
}
|
||||
}, 60000)
|
||||
// activity_id 方式
|
||||
query.value = getUrlPathName()
|
||||
if (!useStore.userInfo.srcList.url || useStore.userInfo.query !== query.value) {
|
||||
|
@ -128,6 +138,11 @@ onLoad(() => {
|
|||
})
|
||||
}
|
||||
})
|
||||
|
||||
onUnload(() => {
|
||||
clearInterval(timer)
|
||||
timer = null
|
||||
})
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
|
Loading…
Reference in New Issue