Fix: 隔离AI头像,防止普通用户使用,并修复聊天公屏图像的调用
This commit is contained in:
|
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 60 KiB |
@@ -96,7 +96,7 @@
|
|||||||
let botDiv = document.createElement('div');
|
let botDiv = document.createElement('div');
|
||||||
botDiv.className = 'user-item';
|
botDiv.className = 'user-item';
|
||||||
botDiv.innerHTML = `
|
botDiv.innerHTML = `
|
||||||
<img class="user-head" src="/images/headface/1.gif" onerror="this.src='/images/headface/1.gif'">
|
<img class="user-head" src="/images/ai_bot.png" onerror="this.src='/images/headface/1.gif'">
|
||||||
<span class="user-name">AI小班长</span><span style="font-size:12px; margin-left:2px;" title="聊天机器人">🤖</span>
|
<span class="user-name">AI小班长</span><span style="font-size:12px; margin-left:2px;" title="聊天机器人">🤖</span>
|
||||||
`;
|
`;
|
||||||
botDiv.onclick = () => {
|
botDiv.onclick = () => {
|
||||||
@@ -229,8 +229,12 @@
|
|||||||
// 获取发言者头像
|
// 获取发言者头像
|
||||||
const senderInfo = onlineUsers[msg.from_user];
|
const senderInfo = onlineUsers[msg.from_user];
|
||||||
const senderHead = ((senderInfo && senderInfo.headface) || '1.gif').toLowerCase();
|
const senderHead = ((senderInfo && senderInfo.headface) || '1.gif').toLowerCase();
|
||||||
|
let headImgSrc = `/images/headface/${senderHead}`;
|
||||||
|
if (msg.from_user === 'AI小班长') {
|
||||||
|
headImgSrc = '/images/ai_bot.png';
|
||||||
|
}
|
||||||
const headImg =
|
const headImg =
|
||||||
`<img src="/images/headface/${senderHead}" style="display:inline;width:16px;height:16px;vertical-align:middle;margin-right:2px;" onerror="this.src='/images/headface/1.gif'">`;
|
`<img src="${headImgSrc}" style="display:inline;width:16px;height:16px;vertical-align:middle;margin-right:2px;" onerror="this.src='/images/headface/1.gif'">`;
|
||||||
|
|
||||||
let html = '';
|
let html = '';
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user