This commit is contained in:
parent
eecbd88eea
commit
75a4f1b191
|
|
@ -316,37 +316,51 @@ const Login: React.FC = () => {
|
||||||
if (!anonInfo.nickName) {
|
if (!anonInfo.nickName) {
|
||||||
return message.error('请输入参会昵称!')
|
return message.error('请输入参会昵称!')
|
||||||
}
|
}
|
||||||
PostAnonLogin(anonInfo).then((res) => {
|
storage.setItem('loading', true)
|
||||||
|
PostAnonLogin(anonInfo).then(async (res) => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
storage.setItem('user', JSON.stringify(res.data))
|
storage.setItem('user', JSON.stringify(res.data))
|
||||||
storage.setItem('userLogin', true)
|
storage.setItem('userLogin', true)
|
||||||
startSignalr()
|
await startSignalr()
|
||||||
getRoomRtcToken(anonInfo.roomNum, (options: any) => {
|
getRoomRtcToken(anonInfo.roomNum, (options: any) => {
|
||||||
if (options) {
|
if (options) {
|
||||||
GetRoomInfo(anonInfo.roomNum).then(async (res) => {
|
GetRoomInfo(anonInfo.roomNum).then(async (res) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
window.electron.getWindowSize().then((res: any) => {
|
setTimeout(() => {
|
||||||
window.electron.setMainWindowSize({
|
storage.setItem('loading', false)
|
||||||
width: Math.ceil(res.width / 1.5),
|
window.electron.getWindowSize().then((res: any) => {
|
||||||
height: Math.ceil(res.height / 1.3),
|
window.electron.setMainWindowSize({
|
||||||
|
width: Math.ceil(res.width / 1.5),
|
||||||
|
height: Math.ceil(res.height / 1.3),
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
navigate(`/meeting`, {
|
||||||
navigate(`/meeting`, {
|
state: {
|
||||||
state: {
|
channelId: anonInfo.roomNum,
|
||||||
channelId: anonInfo.roomNum,
|
token: options.token,
|
||||||
token: options.token,
|
tokenA: options.tokenA,
|
||||||
tokenA: options.tokenA,
|
roomId: res.data.id,
|
||||||
roomId: res.data.id,
|
roomName: res.data.roomName,
|
||||||
roomName: res.data.roomName,
|
enableMicr: false,
|
||||||
enableMicr: false,
|
enableCamera: 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>
|
}}>进入</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ export const startSignalr = async () => {
|
||||||
accessTokenFactory: () => user.token
|
accessTokenFactory: () => user.token
|
||||||
})
|
})
|
||||||
.build();
|
.build();
|
||||||
onStart()
|
await onStart()
|
||||||
storage.setItem('isSignalr', true)
|
storage.setItem('isSignalr', true)
|
||||||
connection.onclose(async () => {
|
connection.onclose(async () => {
|
||||||
await onStart()
|
await onStart()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue