Commit efff3c48 by lijiabin

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

parent a15edb8f
...@@ -108,7 +108,7 @@ export const constantsRoute = [ ...@@ -108,7 +108,7 @@ export const constantsRoute = [
}, },
], ],
}, },
// 点进去其他用户的个人中心 // 点进去其他用户的个人中心 这里面有bug
{ {
path: 'otherUserPage/:userId/:isReal', path: 'otherUserPage/:userId/:isReal',
name: 'CultureOtherUserPage', name: 'CultureOtherUserPage',
......
...@@ -102,8 +102,7 @@ ...@@ -102,8 +102,7 @@
</template> </template>
<script lang="tsx" setup> <script lang="tsx" setup>
import { hasOfficialAccount, getOtherUserData, getOtherUserPostData } from '@/api' import { getOtherUserData, getOtherUserPostData } from '@/api'
import type { OfficialAccountItemDto } from '@/api/user/types'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import { usePageSearch, useNavigation } from '@/hooks' import { usePageSearch, useNavigation } from '@/hooks'
import { articleTypeListOptions, BooleanFlag } from '@/constants' import { articleTypeListOptions, BooleanFlag } from '@/constants'
...@@ -137,32 +136,33 @@ const openSendMessage = () => { ...@@ -137,32 +136,33 @@ const openSendMessage = () => {
isReal: routeIsRealFlag.value, isReal: routeIsRealFlag.value,
}) })
} }
const { list, total, searchParams, goToPage, changePageSize } = usePageSearch( const { list, total, searchParams, goToPage, changePageSize, refresh } = usePageSearch(
getOtherUserPostData, getOtherUserPostData,
{ {
defaultParams: { defaultParams: {
createUserId: route.params.userId as string, createUserId: route.params.userId as string,
isReal: +(route.params.isReal 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) 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({ const { data } = await getOtherUserData({
userId: route.params.userId as string, userId: route.params.userId as string,
isReal: +(route.params.isReal as string), isReal: +(route.params.isReal as string),
}) })
userInfo.value = data userInfo.value = data
}) refresh()
onMounted(() => {
getIsOfficial()
}) })
</script> </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