feat(web): hide realname when not logged in
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Baoshuo Ren 2022-12-03 15:09:04 +08:00
parent 1c2f06c253
commit 4959e6da45
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A

View File

@ -222,10 +222,13 @@ class UOJUser {
}
if ($user['usergroup'] == 'B') {
return '<span class="text-danger">' . $user['username'] . '</span>';
return HTML::tag('a', ['class' => 'text-danger fw-bold', 'href' => "/user/{$user['username']}"], $user['username']);
}
return HTML::tag('span', ['class' => 'uoj-username', 'data-realname' => trim(HTML::escape($user['realname']))], $user['username']);
// 未登录不可查看真实姓名
$realname = Auth::check() ? $user['realname'] : '';
return HTML::tag('span', ['class' => 'uoj-username', 'data-realname' => trim(HTML::escape($realname))], $user['username']);
}
public static function getUpdatedExtraVisitHistory($history, $cur) {