Онлайн правое меню

This commit is contained in:
iriska-gri committed 2024-01-23 10:54:51 +03:00
1 parent 3e9d7272e0
commit 5a664524d8
1 file changed
+26 -18
+26 -18
View File
@@ -4,7 +4,8 @@
variant="text"
v-for="x in onlineuser"
:key="x"
class="my-1"
height="50"
>
<v-avatar
size="36px"
@@ -32,6 +33,7 @@ import {checkremote} from '@/utils/universal_functions'
import InfoUserCard from './UI/infoUserCard.vue'
export default {
components: { InfoUserCard},
setup(){
@@ -45,29 +47,35 @@ export default {
}}
const accountStore = useAccountStore()
let onlineuser= ref([])
const connect = new WebSocket(baseWS+"ws/watcher/?token="+localStorage.access)
const connect = new WebSocket(baseWS+"ws/watcher/?token="+localStorage.access)
const whatuser=(x)=> {
loging.value = x
open.value = true
}
const whatuser=(x)=> {
loging.value = x
open.value = true
}
connect.onmessage=(e)=>{
let data = JSON.parse(e.data)
wsfuncs[data['message']['action']](data.message.data)
}
connect.onmessage=(e)=>{
let data = JSON.parse(e.data)
wsfuncs[data['message']['action']](data.message.data)
watch(()=>accountStore.cod2user,function(){
if (!accountStore.cod2user.value){
connect.close()
}
watch(()=>accountStore.cod2user,function(){
if (!accountStore.cod2user.value){
connect.close()
}
})
return {loging,open, onlineuser, checkremote,spravURL, whatuser, accountStore}
return {
loging,
open,
onlineuser,
checkremote,
spravURL,
whatuser,
accountStore
}
}
}
</script>