import { connectWebsocket } from '@/utils/WebSocket'
import Cookie from 'js-cookie'
let WebsocketConnect = {
created () {
let token = Cookie.get('token')
if (token) {
connectWebsocket('ws:地址' + token, 'openexe', (res) => { // 连接之后
this.$notify({
title: '提醒',
message: res,
type: 'success',
duration: 0
});
}
)
}
}
}
export default WebsocketConnect;
vue2 websocket连接
最新推荐文章于 2024-05-20 13:24:42 发布