退出时清空表格记忆缓存

This commit is contained in:
lai
2024-06-17 19:19:23 +08:00
parent 490db476dd
commit f72b79c628
2 changed files with 25 additions and 1 deletions

View File

@@ -9,6 +9,9 @@ import useUserStore from '@/store/modules/user';
import useAlarmStore from '@/store/modules/alarm';
import useLockedStore from '@/store/modules/locked';
import { hasPermissions } from '@/plugins/auth-user';
import { dbClear } from '@/utils/cache-db-utils';
import { CACHE_DB_TABLE_DND } from '@/constants/cache-keys-constants';
const { isFullscreen, toggle } = useFullscreen();
const { t, changeLocale, optionsLocale } = useI18n();
const lockedStore = useLockedStore();
@@ -26,7 +29,10 @@ function fnClick({ key }: MenuInfo) {
router.push({ name: 'Profile' });
break;
case 'logout':
userStore.fnLogOut().finally(() => router.push({ name: 'Login' }));
userStore.fnLogOut().finally(() => {
dbClear(CACHE_DB_TABLE_DND);
router.push({ name: 'Login' });
});
break;
}
}