|  |  | 
 |  |  | import { useDesign } from '@/hooks/web/useDesign' | 
 |  |  | import { CACHE_KEY, useCache } from '@/hooks/web/useCache' | 
 |  |  | import routerSearch from '@/components/RouterSearch/index.vue' | 
 |  |  | import {useUserStore} from "@/store/modules/user"; | 
 |  |  | import {useTagsViewStore} from "@/store/modules/tagsView"; | 
 |  |  |  | 
 |  |  | defineOptions({ name: 'APP' }) | 
 |  |  |  | 
 |  |  | const userStore = useUserStore() | 
 |  |  |  | 
 |  |  | const tagsViewStore = useTagsViewStore() | 
 |  |  |  | 
 |  |  | const { getPrefixCls } = useDesign() | 
 |  |  | const prefixCls = getPrefixCls('app') | 
 |  |  | 
 |  |  |   appStore.setIsDark(isDarkTheme) | 
 |  |  | } | 
 |  |  | setDefaultTheme() | 
 |  |  |  | 
 |  |  | /** 初始化 **/ | 
 |  |  | onMounted(() => { | 
 |  |  |   window.addEventListener('unload', handleUnload); | 
 |  |  | }) | 
 |  |  |  | 
 |  |  | onBeforeUnmount(() => { | 
 |  |  |   window.removeEventListener('unload', handleUnload); | 
 |  |  | }) | 
 |  |  |  | 
 |  |  | const handleUnload = async () => { | 
 |  |  |   await userStore.loginOut() | 
 |  |  |   tagsViewStore.delAllViews() | 
 |  |  | } | 
 |  |  |  | 
 |  |  | </script> | 
 |  |  | <template> | 
 |  |  |   <ConfigGlobal :size="currentSize"> |