fix:【infra 基础设施】websocket 推送,无法选中所有人

This commit is contained in:
YunaiV
2025-09-06 21:21:43 +08:00
parent 4cbbad4d40
commit 74ffefb09f
2 changed files with 14 additions and 17 deletions

View File

@@ -99,7 +99,7 @@ watchEffect(() => {
/** 发送消息 */
const sendText = ref(''); // 发送内容
const sendUserId = ref(''); // 发送人
const sendUserId = ref('all'); // 发送人
function handlerSend() {
if (!sendText.value.trim()) {
message.warning('消息内容不能为空');
@@ -109,7 +109,7 @@ function handlerSend() {
// 1.1 先 JSON 化 message 消息内容
const messageContent = JSON.stringify({
text: sendText.value,
toUserId: sendUserId.value,
toUserId: sendUserId.value === 'all' ? undefined : sendUserId.value,
});
// 1.2 再 JSON 化整个消息
const jsonMessage = JSON.stringify({