Commit efff3c48 by lijiabin

【需求 21402】 fix: 修复keep-alive相关bug

parent a15edb8f
......@@ -108,7 +108,7 @@ export const constantsRoute = [
},
],
},
// 点进去其他用户的个人中心
// 点进去其他用户的个人中心 这里面有bug
{
path: 'otherUserPage/:userId/:isReal',
name: 'CultureOtherUserPage',
......
......@@ -102,8 +102,7 @@
</template>
<script lang="tsx" setup>
import { hasOfficialAccount, getOtherUserData, getOtherUserPostData } from '@/api'
import type { OfficialAccountItemDto } from '@/api/user/types'
import { getOtherUserData, getOtherUserPostData } from '@/api'
import dayjs from 'dayjs'
import { usePageSearch, useNavigation } from '@/hooks'
import { articleTypeListOptions, BooleanFlag } from '@/constants'
......@@ -137,32 +136,33 @@ const openSendMessage = () => {
isReal: routeIsRealFlag.value,
})
}
const { list, total, searchParams, goToPage, changePageSize } = usePageSearch(
const { list, total, searchParams, goToPage, changePageSize, refresh } = usePageSearch(
getOtherUserPostData,
{
defaultParams: {
createUserId: route.params.userId as string,
isReal: +(route.params.isReal as string),
},
immediate: false,
},
)
const officialAccountList = ref<OfficialAccountItemDto[]>([])
const getIsOfficial = async () => {
const { data } = await hasOfficialAccount()
officialAccountList.value = data
}
const userInfo = ref<OtherUserInfoDto>({} as OtherUserInfoDto)
onMounted(async () => {
// onMounted(async () => {
// const { data } = await getOtherUserData({
// userId: route.params.userId as string,
// isReal: +(route.params.isReal as string),
// })
// userInfo.value = data
// })
onActivated(async () => {
const { data } = await getOtherUserData({
userId: route.params.userId as string,
isReal: +(route.params.isReal as string),
})
userInfo.value = data
})
onMounted(() => {
getIsOfficial()
refresh()
})
</script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment