This commit is contained in:
yj 2024-08-22 14:24:52 +08:00
parent a20f98639c
commit 12bc3bf641
6 changed files with 31 additions and 31 deletions

View File

@ -204,11 +204,6 @@ const App: React.FC = () => {
const toSrc = (path: string): void => {
switch (path) {
case '/login':
window.electron.setMainWindowSize({
width: 752,
height: 520,
key: 'login'
})
storage.removeItem('user')
navigate('/login')
break;

View File

@ -124,4 +124,9 @@ export const GetLeaveAll = (data: any) =>
request({
url: `/room/leave-all?roomNum=${data.roomNum}`,
method: 'get'
})
export const GetApplySpeak = (roomNum: string) =>
request({
url: `/room/apply-speak?roomNum=${roomNum}`,
method: 'get'
})

View File

@ -132,15 +132,6 @@ const Home: React.FC = () => {
title="提示"
description="确认退出吗?"
onConfirm={() => {
try {
window.electron.setMainWindowSize({
width: 752,
height: 520,
key: 'login'
})
} catch {
}
navigate('/login')
storage.removeItem('user')
}}

View File

@ -8,7 +8,7 @@ import { SearchOutlined, EllipsisOutlined, ExclamationCircleFilled } from '@ant-
import { useLocation, useNavigate } from 'react-router-dom';
import { thumbImageBufferToBase64 } from '@/utils/package/base64'
import { storage } from '@/utils';
import { GetRoomUser, PostOpenMicr, PostOpenCamera, GetLeaveAll, PostRoomManager, DeleteRoomManager, GetRoomKickout, GetShowUser, PostShowUser, GetJoin, GetLeave, PostMuteAll, GetRoomUserItem } from '@/api/Meeting';
import { GetRoomUser, PostOpenMicr, PostOpenCamera, GetLeaveAll, PostRoomManager, DeleteRoomManager, GetRoomKickout, GetShowUser, PostShowUser, GetJoin, GetLeave, PostMuteAll, GetRoomUserItem, GetApplySpeak } from '@/api/Meeting';
import ImageUrl from '@/utils/package/ImageUrl'
import agora from '@/utils/package/agora'
import { onInvoke, onSignalr, offSignalr, onStart } from '@/utils/package/signalr';
@ -153,11 +153,13 @@ const Meeting: React.FC = () => {
let time = null as any;
setUser(userInfo)
setTimeout(() => {
window.electron.getIsMaximized().then((res: boolean) => {
if (!res) {
window.electron.setViewStatus('maximize')
}
})
if (location.hash.indexOf('/login') === -1) {
window.electron.getIsMaximized().then((res: boolean) => {
if (!res) {
window.electron.setViewStatus('maximize')
}
})
}
}, 1000)
setMeetingMode('StandardMode');
agora.init(true)
@ -372,8 +374,8 @@ const Meeting: React.FC = () => {
}
})
break;
// 申请发言
case '申请发言哦':
// 申请发言
case 'ApplyToSpeak':
api.open({
message: '',
description: <div>
@ -807,9 +809,13 @@ const Meeting: React.FC = () => {
sharedFilesModelRef.current.getData()
break;
case '申请发言':
footerListTemplate[itemIndex][rowIndex].title = '结束发言'
footerListTemplate[itemIndex][rowIndex].active = true
setFooterList(footerListTemplate)
GetApplySpeak(state.channelId).then(async (res) => {
if (res.code === 200) {
footerListTemplate[itemIndex][rowIndex].title = '结束发言'
footerListTemplate[itemIndex][rowIndex].active = true
setFooterList(footerListTemplate)
}
})
break;
case '结束发言':
footerListTemplate[itemIndex][rowIndex].title = '申请发言'

View File

@ -144,6 +144,14 @@ export const onSignalr = (callBack: Function) => {
user
})
});
// 申请发言
connection.on("ApplyToSpeak", (uid: string, uname: string) => {
callBack({
key: 'ApplyToSpeak',
uid,
uname
})
});
}
}
export const offSignalr = () => {

View File

@ -60,7 +60,7 @@ class Request {
message.error(resData.message)
}
}
if (resData.code === 1403) {
if (resData.code === 1403 || resData.code === 1000) {
toLogin()
}
return resData
@ -112,11 +112,6 @@ class Request {
}
}
function toLogin() {
window.electron.setMainWindowSize({
width: 752,
height: 520,
key: 'login'
})
storage.removeItem('user')
location.href = location.origin + '/#/login'
}