From 6dcd43b9144994df94df0af5cfdd7e9140edea02 Mon Sep 17 00:00:00 2001 From: Baoshuo Date: Sun, 15 Jan 2023 09:15:30 +0800 Subject: [PATCH] feat(user): more username colors --- web/app/controllers/user_info_edit.php | 6 ++++-- web/app/models/UOJUser.php | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/web/app/controllers/user_info_edit.php b/web/app/controllers/user_info_edit.php index e714e20..bcf9063 100644 --- a/web/app/controllers/user_info_edit.php +++ b/web/app/controllers/user_info_edit.php @@ -254,13 +254,15 @@ EOD); if (isSuperUser($user)) { $additional_colors['#9d3dcf'] = '紫色 - #9d3dcf'; - $additional_colors['#fe4c61'] = '红色 - #fe4c61'; } $update_profile_form->addVSelect('username_color', $additional_colors + [ '#0d6efd' => '蓝色 - #0d6efd', '#2da44e' => '绿色 - #2da44e', - '#f48fb1' => '粉色 - #f48fb1', + '#e85aad' => '粉色 - #e85aad', + '#f32a38' => '红色 - #f32a38', + '#f57c00' => '橙色 - #f57c00', + '#00acc1' => '青色 - #00acc1', ], '用户名颜色', $extra['username_color']); } $update_profile_form->handle = function (&$vdata) use ($user) { diff --git a/web/app/models/UOJUser.php b/web/app/models/UOJUser.php index 388b724..fe45d7f 100644 --- a/web/app/models/UOJUser.php +++ b/web/app/models/UOJUser.php @@ -229,8 +229,8 @@ class UOJUser { return $custom_color ?: '#9d3dcf'; } - // 前管理员设置颜色为紫色、红色的,颜色改为蓝色 - if ($custom_color == '#9d3dcf' || $custom_color == '#fe4c61') { + // 前管理员设置颜色为紫色的,颜色改为蓝色 + if ($custom_color == '#9d3dcf') { return '#0d6efd'; }