存为session
This commit is contained in:
parent
a61f2a8ba0
commit
a7140ad0de
|
@ -74,8 +74,10 @@ const getUrlPathName = () => {
|
|||
}
|
||||
|
||||
window.parent.addEventListener('message', function (event) {
|
||||
let srcData = {}
|
||||
const timestamp = new Date().getTime()
|
||||
let srcData = {
|
||||
url: '',
|
||||
title: '',
|
||||
}
|
||||
if (event.data.data.type === 'login') {
|
||||
srcData = {
|
||||
url: contentData.content_templates.source + `?activity_code=${query.value}`,
|
||||
|
@ -94,20 +96,22 @@ window.parent.addEventListener('message', function (event) {
|
|||
title: contentData.user_content_templates.moduledesc,
|
||||
}
|
||||
} else if (event.data.data.type === 'couponBack') {
|
||||
srcData = {
|
||||
url: contentData.content_templates.source + `?activity_code=${query.value}`,
|
||||
title: contentData.content_templates.moduledesc,
|
||||
}
|
||||
return initContent()
|
||||
// srcData = {
|
||||
// url: contentData.content_templates.source + `?activity_code=${query.value}`,
|
||||
// title: contentData.content_templates.moduledesc,
|
||||
// }
|
||||
} else if (event.data.data.type === 'logout') {
|
||||
srcData = {
|
||||
url: contentData.login_content_templates.source,
|
||||
title: contentData.login_content_templates.moduledesc,
|
||||
}
|
||||
}
|
||||
srcList.url =
|
||||
srcList.url + (srcList.url.includes('?') ? '×tamp=' : '?timestamp=') + timestamp
|
||||
nextTick(() => {
|
||||
Object.assign(srcList, srcData)
|
||||
Object.assign(srcList, {
|
||||
url: getTimesTamp(srcData.url),
|
||||
title: srcList.title,
|
||||
})
|
||||
uni.setNavigationBarTitle({
|
||||
title: srcList.title,
|
||||
})
|
||||
|
@ -115,14 +119,14 @@ window.parent.addEventListener('message', function (event) {
|
|||
})
|
||||
})
|
||||
|
||||
const initContent = async () => {
|
||||
async function initContent() {
|
||||
const params = {}
|
||||
params[codeType[code]] = activityCode.value || ''
|
||||
const res: any = await getContent(params)
|
||||
initData(res)
|
||||
}
|
||||
|
||||
const initData = (res) => {
|
||||
function initData(res) {
|
||||
if (res.code === 200) {
|
||||
const {
|
||||
login_content_template: loginValid,
|
||||
|
|
|
@ -4,10 +4,11 @@ import { createPersistedState } from 'pinia-plugin-persistedstate' // 数据持
|
|||
const store = createPinia()
|
||||
store.use(
|
||||
createPersistedState({
|
||||
storage: {
|
||||
getItem: uni.getStorageSync,
|
||||
setItem: uni.setStorageSync,
|
||||
},
|
||||
storage: sessionStorage,
|
||||
// storage: {
|
||||
// getItem: uni.getStorageSync,
|
||||
// setItem: uni.setStorageSync,
|
||||
// },
|
||||
}),
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue