样式:女生用户名显示为玫粉色(#e91e8c) + 修复 sex 整数比较

- 用户列表中女性(sex=2)名字颜色设为玫粉色
- 修复 scripts.blade.php 中 sex 从字符串比较改为整数比较
This commit is contained in:
2026-02-26 22:59:41 +08:00
parent bc80c42fa3
commit b80a74655c

View File

@@ -144,9 +144,11 @@
badges += `<span style="font-size:11px; margin-left:2px;" title="管理员">🛡️</span>`;
}
// 女生名字使用玫粉色
const nameColor = (user.sex == 2) ? 'color:#e91e8c;' : '';
item.innerHTML = `
<img class="user-head" src="/images/headface/${headface}" onerror="this.src='/images/headface/1.GIF'">
<span class="user-name">${username}</span>${badges}
<span class="user-name" style="${nameColor}">${username}</span>${badges}
`;
item.onclick = () => {
@@ -226,7 +228,7 @@
const res = await fetch('/user/' + encodeURIComponent(username));
const info = await res.json();
const sexText = info.sex === '女' ? '' : '';
const sexText = info.sex == 2 ? '女' : (info.sex == 1 ? '' : '保密');
const level = info.user_level || 0;
const exp = info.exp_num || 0;
const jjb = info.jjb || 0;
@@ -351,7 +353,7 @@
renderUserList();
// 原版风格:完整句式的随机趣味欢迎语
const gender = user.sex === '女' ? '美女' : '帅哥';
const gender = user.sex == 2 ? '美女' : '帅哥';
const uname = user.username;
const welcomeTemplates = [
`${gender}<b>${uname}</b>开着刚买不久的车,来到了,见到各位大虾,拱手曰:"众位大虾,小生有礼了"`,