fix: 修复切换账号消息列表未更新bug

This commit is contained in:
范鹏 2024-09-30 15:18:05 +08:00
parent fcf3297f5d
commit 4a2614ff83

View File

@ -67,6 +67,7 @@
import { phoneLoginRequest } from '@/api/user'
import env from '@/config/env'
import { setStorage, getStorage, removeStorage } from '@/utils/storage'
import { useNotificationStore } from '../../stores/notification'
export default {
data() {
@ -80,7 +81,8 @@
},
computed: {
...mapState(useUserStore, ['isLogin']),
...mapState(useLockStore, ['lockSearch'])
...mapState(useLockStore, ['lockSearch']),
...mapState(useNotificationStore, ['notificationSearch'])
},
async onLoad() {
this.buttonInfo = await this.getButtonInfo()
@ -97,6 +99,7 @@
methods: {
...mapActions(useBasicStore, ['getButtonInfo', 'routeJump']),
...mapActions(useLockStore, ['getLockList', 'updateLockSearch']),
...mapActions(useNotificationStore, ['getNotificationList', 'updateNotificationSearch']),
...mapActions(useUserStore, ['updateLoginStatus', 'phoneLogin', 'updateUserInfo', 'getUserInfo',
'checkSession']),
selectEnv(env) {
@ -138,6 +141,10 @@
})
this.getUserInfo()
this.getLockList(this.lockSearch)
this.updateNotificationSearch({
pageNo: 1
})
this.getNotificationList(this.notificationSearch)
uni.showToast({
title: '账号切换成功',
icon: 'none'