强制退出功能

This commit is contained in:
橙子
2022-10-03 18:27:37 +08:00
parent 3943536485
commit 1a2d9ba2b2
12 changed files with 208 additions and 248 deletions

View File

@@ -5,6 +5,11 @@
<script setup>
import useSettingsStore from '@/store/modules/settings'
import { handleThemeStyle } from '@/utils/theme'
import useUserStore from '@/store/modules/user'
import { storeToRefs } from 'pinia';
import signalR from '@/utils/signalR'
const {token}=storeToRefs(useUserStore());
onMounted(() => {
nextTick(() => {
@@ -13,5 +18,12 @@ onMounted(() => {
})
})
//这里还需要监视token的变化重新进行signalr连接
watch(()=>token.value,async (newValue,oldValue)=>{
console.log("重新连接");
await signalR.close();
await signalR.start();
})
</script>