活动刷新问题

This commit is contained in:
lf 2024-06-19 17:44:40 +08:00
parent 6c54f085fe
commit 71544a62d3
1 changed files with 14 additions and 2 deletions

View File

@ -100,8 +100,13 @@ const initContent = async () => {
const res: any = await getContent(params)
Object.assign(contentData, res.data)
if (res?.code === 200 && res.data.login_content_template.validate_login === 1) {
const timestamp = new Date().getTime()
const url =
res.data.login_content_templates.source +
(res.data.login_content_templates.source.includes('?') ? '&timestamp=' : '?timestamp=') +
timestamp
Object.assign(srcList, {
url: res.data.login_content_templates.source,
url,
title: res.data.login_content_templates.moduledesc,
})
uni.setNavigationBarTitle({
@ -135,7 +140,14 @@ onLoad(() => {
if (!useStore.userInfo.srcList.url || useStore.userInfo.query !== query.value) {
initContent()
} else {
Object.assign(srcList, useStore.userInfo.srcList)
const timestamp = new Date().getTime()
const url =
useStore.userInfo.srcList.url +
(useStore.userInfo.srcList.url.includes('?') ? '&timestamp=' : '?timestamp=') +
timestamp
Object.assign(srcList, useStore.userInfo.srcList, {
url,
})
Object.assign(contentData, useStore.userInfo.contentData)
uni.setNavigationBarTitle({
title: srcList.title,