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