This commit is contained in:
yj 2024-09-26 11:40:23 +08:00
parent eecbd88eea
commit 75a4f1b191
2 changed files with 33 additions and 19 deletions

View File

@ -316,37 +316,51 @@ const Login: React.FC = () => {
if (!anonInfo.nickName) {
return message.error('请输入参会昵称!')
}
PostAnonLogin(anonInfo).then((res) => {
storage.setItem('loading', true)
PostAnonLogin(anonInfo).then(async (res) => {
if (res.code == 200) {
storage.setItem('user', JSON.stringify(res.data))
storage.setItem('userLogin', true)
startSignalr()
await startSignalr()
getRoomRtcToken(anonInfo.roomNum, (options: any) => {
if (options) {
GetRoomInfo(anonInfo.roomNum).then(async (res) => {
if (res.code === 200) {
window.electron.getWindowSize().then((res: any) => {
window.electron.setMainWindowSize({
width: Math.ceil(res.width / 1.5),
height: Math.ceil(res.height / 1.3),
setTimeout(() => {
storage.setItem('loading', false)
window.electron.getWindowSize().then((res: any) => {
window.electron.setMainWindowSize({
width: Math.ceil(res.width / 1.5),
height: Math.ceil(res.height / 1.3),
})
})
})
navigate(`/meeting`, {
state: {
channelId: anonInfo.roomNum,
token: options.token,
tokenA: options.tokenA,
roomId: res.data.id,
roomName: res.data.roomName,
enableMicr: false,
enableCamera: false,
}
})
navigate(`/meeting`, {
state: {
channelId: anonInfo.roomNum,
token: options.token,
tokenA: options.tokenA,
roomId: res.data.id,
roomName: res.data.roomName,
enableMicr: false,
enableCamera: false,
}
})
}, 2000)
} else {
storage.setItem('loading', false)
}
}).catch(() => {
storage.setItem('loading', false)
})
} else {
storage.setItem('loading', false)
}
}).catch(() => {
storage.setItem('loading', false)
})
}
}).catch(() => {
storage.setItem('loading', false)
})
}}></Button>
</div>

View File

@ -10,7 +10,7 @@ export const startSignalr = async () => {
accessTokenFactory: () => user.token
})
.build();
onStart()
await onStart()
storage.setItem('isSignalr', true)
connection.onclose(async () => {
await onStart()