Commit b2f6300b authored by 李腾's avatar 李腾

feat: update

parent 828a1e8c
......@@ -56,26 +56,30 @@ const BasicLayout = props => {
// const audioRef = useRef()
useEffect(() => {
const token = window.localStorage.getItem('token');
const channelId = 100001;
console.log('666666666666');
const socket = new Socket({
url: getSocketUrl({ token, channelId }),
});
socket.connection();
try {
const token = window.localStorage.getItem('token');
const channelId = 100001;
console.log('666666666666');
const socket = new Socket({
url: getSocketUrl({ token, channelId }),
});
socket.connection();
socket.event.on('open', () => {
console.log('连接成功3');
});
socket.event.on('message', msg => {
// audioRef.current.click()
dispatch({
type: 'messageReminder/setUnReadData',
payload: [JSON.parse(msg.data)],
socket.event.on('open', () => {
console.log('连接成功3');
});
socket.event.on('message', msg => {
// audioRef.current.click()
dispatch({
type: 'messageReminder/setUnReadData',
payload: [JSON.parse(msg.data)],
});
// socket.play()
});
// socket.play()
});
} catch (e) {
console.log(e);
}
// let a = 100000000000;
// setInterval(() => {
// a++;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment