Files
Yi.Admin/Yi.Vue3.X.RuoYi/src/App.vue

30 lines
668 B
Vue
Raw Normal View History

2022-09-07 18:30:43 +08:00
<template>
<router-view />
</template>
<script setup>
import useSettingsStore from '@/store/modules/settings'
import { handleThemeStyle } from '@/utils/theme'
2022-10-03 18:27:37 +08:00
import useUserStore from '@/store/modules/user'
import { storeToRefs } from 'pinia';
import signalR from '@/utils/signalR'
const {token}=storeToRefs(useUserStore());
2022-09-07 18:30:43 +08:00
onMounted(() => {
nextTick(() => {
// 初始化主题样式
handleThemeStyle(useSettingsStore().theme)
})
})
2022-10-03 17:04:59 +08:00
2022-10-03 18:27:37 +08:00
2022-10-03 17:04:59 +08:00
//这里还需要监视token的变化重新进行signalr连接
2022-10-03 18:27:37 +08:00
watch(()=>token.value,async (newValue,oldValue)=>{
console.log("重新连接");
2022-10-03 22:56:36 +08:00
// await signalR.close();
2022-10-03 18:27:37 +08:00
await signalR.start();
})
2022-09-07 18:30:43 +08:00
</script>