修复:移除前端对 headface 属性的强制小写转换,避免自定义上传头像(带有大小写字符)出现404问题

This commit is contained in:
2026-04-02 17:01:13 +08:00
parent c7142efa99
commit caf4742dd8
2 changed files with 3 additions and 3 deletions

View File

@@ -284,7 +284,7 @@
item.className = 'user-item';
item.dataset.username = username;
const headface = (user.headface || '1.gif').toLowerCase();
const headface = (user.headface || '1.gif');
const headImgSrc = headface.startsWith('storage/') ? '/' + headface : '/images/headface/' +
headface;
@@ -516,7 +516,7 @@
// 普通用户(包括 AI小班长用数据库头像播报类用特殊喇叭图标
const senderInfo = onlineUsers[msg.from_user];
const senderHead = ((senderInfo && senderInfo.headface) || '1.gif').toLowerCase();
const senderHead = ((senderInfo && senderInfo.headface) || '1.gif');
let headImgSrc = senderHead.startsWith('storage/') ? '/' + senderHead : `/images/headface/${senderHead}`;
if (msg.from_user.endsWith('播报') || msg.from_user === '星海小博士' || msg.from_user === '系统传音' || msg.from_user === '系统公告') {
headImgSrc = '/images/bugle.png';

View File

@@ -604,7 +604,7 @@
<div class="modal-body">
<div class="profile-row">
<img class="profile-avatar" x-show="userInfo.headface"
:src="(userInfo.headface || '1.gif').toLowerCase().startsWith('storage/') ? '/' + (userInfo.headface || '1.gif').toLowerCase() : '/images/headface/' + (userInfo.headface || '1.gif').toLowerCase()"
:src="(userInfo.headface || '1.gif').startsWith('storage/') ? '/' + (userInfo.headface || '1.gif') : '/images/headface/' + (userInfo.headface || '1.gif')"
x-on:error="$el.style.display='none'">
<div class="profile-info">
<h4>