blob: cc5bdf29210eeedd5cd6db7a761334dad962bf3e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
import AuthService from "./AuthService"
import ChatService from "./ChatService"
import store from "@/store/index.js"
import router from '@/router/index.js'
function set_groups(data) {
function group_command(group) {
console.log(group)
}
let groups = {}
data.forEach((group) => {
groups[group.name] = () => group_command(group)
})
return groups
}
export default {
groups() {
return {
async send() {
const {data, status} = await ChatService.get_all_user_groups()
if (status!==200)
return {}
const groups = set_groups(data)
return groups
},
make(searcher) {
searcher.$emit('toogle_group_maker')
},
}
},
logout() {
AuthService.logout()
store.dispatch('logout')
router.push('/login')
},
}
|