fix: 防止发送空白或纯空格消息
在聊天页面和首页发送消息前,增加对消息内容的修剪检查,避免发送仅包含空格的无效消息。
This commit is contained in:
parent
ab4ca595b3
commit
c2f5443eaf
|
|
@ -287,7 +287,7 @@ export default {
|
||||||
|
|
||||||
// 点击发送
|
// 点击发送
|
||||||
handleSend() {
|
handleSend() {
|
||||||
if (!this.messageValue) {
|
if (!this.messageValue || !this.messageValue.trim()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -855,7 +855,7 @@ export default {
|
||||||
|
|
||||||
// 修改发送消息的方法
|
// 修改发送消息的方法
|
||||||
sendMessageFn() {
|
sendMessageFn() {
|
||||||
if (!this.messageValue) {
|
if (!this.messageValue || !this.messageValue.trim()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue