feat: 欢迎语增加右下角弹窗通知;禁止对「大家」发送欢迎

This commit is contained in:
pllx
2026-04-28 14:40:27 +08:00
parent 55fd770fdd
commit abb5512222
3 changed files with 18 additions and 3 deletions
@@ -111,7 +111,11 @@
*/
function sendWelcomeTpl(tpl) {
const toUser = document.getElementById('to_user')?.value || '大家';
const name = toUser === '大家' ? '大家' : toUser;
if (toUser === '大家') {
window.chatDialog?.alert('欢迎语不能对「大家」发送,请先选择具体用户。', '🚫 提示', '#cc4444');
return;
}
const name = toUser;
const prefix = window.chatContext?.welcomePrefix || window.chatContext?.username || '';
const body = tpl.replace(/\{name\}/g, name);
const msg = `${prefix}${body}`;