This commit is contained in:
parent
7e9ad23c49
commit
810c68bc96
16
src/App.tsx
16
src/App.tsx
|
|
@ -9,7 +9,7 @@ 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 { message, Spin } from "antd";
|
import { message, Spin } from "antd";
|
||||||
import { onOtherSignalr, onReconnected, onStart, startSignalr } from "@/utils/package/signalr";
|
import { onOtherSignalr, onReconnected, onStart, onStop, startSignalr } from "@/utils/package/signalr";
|
||||||
import JoinMeetingModal from "@/components/JoinMeetingModal";
|
import JoinMeetingModal from "@/components/JoinMeetingModal";
|
||||||
import UpdateModal from "@/components/UpdateModal";
|
import UpdateModal from "@/components/UpdateModal";
|
||||||
import * as CryptoJS from 'crypto-js';
|
import * as CryptoJS from 'crypto-js';
|
||||||
|
|
@ -121,7 +121,8 @@ const App: React.FC = () => {
|
||||||
joinMeetingModalRef.current.changeModal(item)
|
joinMeetingModalRef.current.changeModal(item)
|
||||||
break;
|
break;
|
||||||
case 'ForceLogout':
|
case 'ForceLogout':
|
||||||
await leaveChannel()
|
message.error(item.message)
|
||||||
|
await leaveChannel(true)
|
||||||
toSrc('/login')
|
toSrc('/login')
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -131,6 +132,7 @@ const App: React.FC = () => {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
try {
|
try {
|
||||||
if (location.hash.indexOf('/login') !== -1) {
|
if (location.hash.indexOf('/login') !== -1) {
|
||||||
|
onStop()
|
||||||
window.electron.setMainWindowSize({
|
window.electron.setMainWindowSize({
|
||||||
width: 752,
|
width: 752,
|
||||||
height: 520,
|
height: 520,
|
||||||
|
|
@ -219,12 +221,14 @@ const App: React.FC = () => {
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const leaveChannel = async (): Promise<void> => {
|
const leaveChannel = async (bool?: boolean): Promise<void> => {
|
||||||
if (location.hash.indexOf('/meeting') === 1) {
|
if (location.hash.indexOf('/meeting') === 1) {
|
||||||
const data = JSON.parse(localStorage.stateInfo);
|
const data = JSON.parse(localStorage.stateInfo);
|
||||||
await GetLeave({
|
if (!bool) {
|
||||||
roomNum: data.channelId,
|
await GetLeave({
|
||||||
})
|
roomNum: data.channelId,
|
||||||
|
})
|
||||||
|
}
|
||||||
await agora.leaveChannel()
|
await agora.leaveChannel()
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,6 @@ import {
|
||||||
} from "agora-electron-sdk";
|
} from "agora-electron-sdk";
|
||||||
import { GetRoomRtcToken } from "@/api/Home/Index";
|
import { GetRoomRtcToken } from "@/api/Home/Index";
|
||||||
import { storage } from '@/utils';
|
import { storage } from '@/utils';
|
||||||
import { onStop } from "./signalr";
|
|
||||||
const option: any = {
|
const option: any = {
|
||||||
appId: 'dcfc466a6ecb4a1f972630065dfb1e75',
|
appId: 'dcfc466a6ecb4a1f972630065dfb1e75',
|
||||||
token: '',
|
token: '',
|
||||||
|
|
@ -137,7 +136,6 @@ const agora = {
|
||||||
stopAllEffect: true,
|
stopAllEffect: true,
|
||||||
stopMicrophoneRecording: true,
|
stopMicrophoneRecording: true,
|
||||||
})
|
})
|
||||||
onStop()
|
|
||||||
agora.stopScreenCapture()
|
agora.stopScreenCapture()
|
||||||
agora.release()
|
agora.release()
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -163,6 +163,7 @@ export const onInvoke = async (str: string, data: any) => {
|
||||||
export const onStop = async () => {
|
export const onStop = async () => {
|
||||||
if (connection) {
|
if (connection) {
|
||||||
connection.stop()
|
connection.stop()
|
||||||
|
connection = ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue