This commit is contained in:
parent
eecbd88eea
commit
75a4f1b191
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ export const startSignalr = async () => {
|
|||
accessTokenFactory: () => user.token
|
||||
})
|
||||
.build();
|
||||
onStart()
|
||||
await onStart()
|
||||
storage.setItem('isSignalr', true)
|
||||
connection.onclose(async () => {
|
||||
await onStart()
|
||||
|
|
|
|||
Loading…
Reference in New Issue