Commit b2f6300b authored by 李腾's avatar 李腾

feat: update

parent 828a1e8c
...@@ -56,26 +56,30 @@ const BasicLayout = props => { ...@@ -56,26 +56,30 @@ const BasicLayout = props => {
// const audioRef = useRef() // const audioRef = useRef()
useEffect(() => { useEffect(() => {
const token = window.localStorage.getItem('token'); try {
const channelId = 100001; const token = window.localStorage.getItem('token');
console.log('666666666666'); const channelId = 100001;
const socket = new Socket({ console.log('666666666666');
url: getSocketUrl({ token, channelId }), const socket = new Socket({
}); url: getSocketUrl({ token, channelId }),
socket.connection(); });
socket.connection();
socket.event.on('open', () => { socket.event.on('open', () => {
console.log('连接成功3'); console.log('连接成功3');
});
socket.event.on('message', msg => {
// audioRef.current.click()
dispatch({
type: 'messageReminder/setUnReadData',
payload: [JSON.parse(msg.data)],
}); });
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; // let a = 100000000000;
// setInterval(() => { // setInterval(() => {
// a++; // 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