This commit is contained in:
parent
83c337e5c4
commit
cf587bc27b
21
src/App.tsx
21
src/App.tsx
|
|
@ -9,8 +9,8 @@ import Login from '@/page/Login/index'
|
||||||
import Meeting from '@/page/Meeting/index'
|
import Meeting from '@/page/Meeting/index'
|
||||||
import NotFound from '@/page/NotFound/index'
|
import NotFound from '@/page/NotFound/index'
|
||||||
import { storage } from '@/utils'
|
import { storage } from '@/utils'
|
||||||
import { Spin } from "antd";
|
import { Spin, message } from "antd";
|
||||||
import { onInvitation, onInvoke, onReconnected } from "@/utils/package/signalr";
|
import { onInvitation, onInvoke, onReconnected, onStart } from "@/utils/package/signalr";
|
||||||
import JoinMeetingModal from "./components/JoinMeetingModal";
|
import JoinMeetingModal from "./components/JoinMeetingModal";
|
||||||
import * as CryptoJS from 'crypto-js';
|
import * as CryptoJS from 'crypto-js';
|
||||||
import { PostLogin } from "@/api/Login";
|
import { PostLogin } from "@/api/Login";
|
||||||
|
|
@ -75,6 +75,8 @@ const App: React.FC = () => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
window.addEventListener('resize', handleResize);
|
window.addEventListener('resize', handleResize);
|
||||||
|
window.addEventListener('online', handleNetworkChange);
|
||||||
|
window.addEventListener('offline', handleNetworkChange);
|
||||||
const originalSetItem = window.localStorage.setItem;
|
const originalSetItem = window.localStorage.setItem;
|
||||||
window.localStorage.setItem = function (key, value) {
|
window.localStorage.setItem = function (key, value) {
|
||||||
originalSetItem.call(this, key, value);
|
originalSetItem.call(this, key, value);
|
||||||
|
|
@ -88,6 +90,8 @@ const App: React.FC = () => {
|
||||||
return () => {
|
return () => {
|
||||||
window.removeEventListener('resize', handleResize);
|
window.removeEventListener('resize', handleResize);
|
||||||
window.removeEventListener('customStorageChange', handleCustomStorageChange);
|
window.removeEventListener('customStorageChange', handleCustomStorageChange);
|
||||||
|
window.removeEventListener('online', handleNetworkChange);
|
||||||
|
window.removeEventListener('offline', handleNetworkChange);
|
||||||
};
|
};
|
||||||
}, []);
|
}, []);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
@ -126,7 +130,18 @@ const App: React.FC = () => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleNetworkChange = (): void => {
|
||||||
|
if (location.hash.indexOf('/meeting') !== -1) {
|
||||||
|
if (navigator.onLine) {
|
||||||
|
message.success('网络已恢复。')
|
||||||
|
setTimeout(async () => {
|
||||||
|
await onStart()
|
||||||
|
}, 1000)
|
||||||
|
} else {
|
||||||
|
message.error('网络已断开!')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Routes>
|
<Routes>
|
||||||
|
|
|
||||||
|
|
@ -137,4 +137,14 @@
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.letterSpacing {
|
||||||
|
>input {
|
||||||
|
letter-spacing: 10px;
|
||||||
|
|
||||||
|
&::placeholder {
|
||||||
|
letter-spacing: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -175,6 +175,7 @@ const Index: React.FC = () => {
|
||||||
<Input
|
<Input
|
||||||
placeholder="请输入房间号"
|
placeholder="请输入房间号"
|
||||||
style={{ marginBottom: '14px' }}
|
style={{ marginBottom: '14px' }}
|
||||||
|
className={styles.letterSpacing}
|
||||||
showCount
|
showCount
|
||||||
maxLength={8}
|
maxLength={8}
|
||||||
value={createRoomFrom.roomNum}
|
value={createRoomFrom.roomNum}
|
||||||
|
|
|
||||||
|
|
@ -55,9 +55,11 @@
|
||||||
height: calc(100% - 20px);
|
height: calc(100% - 20px);
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
background-color: black;
|
background-color: black;
|
||||||
color: white;
|
|
||||||
font-size: 16px;
|
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
|
>div {
|
||||||
|
transform: scale(2);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -271,9 +273,7 @@
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
transform: translate(-50%, -50%);
|
transform: translate(-50%, -50%) scale(2);
|
||||||
font-size: 16px;
|
|
||||||
color: white;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -504,16 +504,6 @@
|
||||||
|
|
||||||
>div {
|
>div {
|
||||||
margin-left: 4px;
|
margin-left: 4px;
|
||||||
width: 30px;
|
|
||||||
height: 30px;
|
|
||||||
overflow: hidden;
|
|
||||||
border-radius: 50%;
|
|
||||||
|
|
||||||
>img {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
object-fit: cover;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -590,7 +590,7 @@ const Meeting: React.FC = () => {
|
||||||
>
|
>
|
||||||
<div className={`${styles.meetingContentSwiperCardVdeio} ${currentVideoId === item.account ? styles.active : ''}`} id={`video-${item.account}`}>
|
<div className={`${styles.meetingContentSwiperCardVdeio} ${currentVideoId === item.account ? styles.active : ''}`} id={`video-${item.account}`}>
|
||||||
<div className={styles.meetingContentSwiperCardVdeioLoading}>
|
<div className={styles.meetingContentSwiperCardVdeioLoading}>
|
||||||
暂无视频
|
<Avatar name={item.userName}/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{meetingContentUser(item)}
|
{meetingContentUser(item)}
|
||||||
|
|
@ -1018,7 +1018,7 @@ const meetingContentError = (currentVideoId: any, item: any) => {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className={`${styles.meetingContentError} ${currentVideoId === item.account ? styles.active : ''}`}>
|
<div className={`${styles.meetingContentError} ${currentVideoId === item.account ? styles.active : ''}`}>
|
||||||
暂无视频
|
<Avatar name={item.userName} />
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue