消息完成
This commit is contained in:
parent
961a64ef6c
commit
3fb0907a68
|
|
@ -148,10 +148,7 @@ const Meeting: React.FC = () => {
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
onSignalr((item: any) => {
|
onSignalr((item: any) => {
|
||||||
console.log(item);
|
setChatList((newChatList: any) => [...newChatList, item])
|
||||||
const newChatList = [...chatList]
|
|
||||||
newChatList.push(item)
|
|
||||||
setChatList(newChatList)
|
|
||||||
})
|
})
|
||||||
}, [])
|
}, [])
|
||||||
// 操作按钮
|
// 操作按钮
|
||||||
|
|
@ -423,11 +420,20 @@ const Meeting: React.FC = () => {
|
||||||
setTextMsg(e.target.value)
|
setTextMsg(e.target.value)
|
||||||
}}></Input.TextArea>
|
}}></Input.TextArea>
|
||||||
<Button type="primary" className='m-ant-btn' style={{ flexShrink: 0, marginTop: '4px' }} onClick={() => {
|
<Button type="primary" className='m-ant-btn' style={{ flexShrink: 0, marginTop: '4px' }} onClick={() => {
|
||||||
onInvoke('sendChannelMsg', {
|
if (textMsg) {
|
||||||
roomNum: state.channelId,
|
onInvoke('sendChannelMsg', {
|
||||||
msg: textMsg,
|
roomNum: state.channelId,
|
||||||
})
|
msg: textMsg,
|
||||||
setTextMsg('')
|
})
|
||||||
|
setChatList((newChatList: any) => [...newChatList, {
|
||||||
|
uid: state.uid,
|
||||||
|
userName: state.userName,
|
||||||
|
message: textMsg,
|
||||||
|
}])
|
||||||
|
setTextMsg('')
|
||||||
|
} else {
|
||||||
|
message.success('请输入内容!')
|
||||||
|
}
|
||||||
}}>发送</Button>
|
}}>发送</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue