From 64262134c4e62ba904d0dba90d479e0168dc7c20 Mon Sep 17 00:00:00 2001 From: kuaifan Date: Wed, 5 Feb 2025 01:33:32 +0900 Subject: [PATCH] =?UTF-8?q?perf:=20=E6=94=AF=E6=8C=81=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E4=BB=AA=E8=A1=A8=E7=9B=98=E6=AC=A2=E8=BF=8E=E8=AF=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/Api/SystemController.php | 6 +++++- resources/assets/js/pages/manage/dashboard.vue | 10 +++++++++- .../pages/manage/setting/components/SystemSetting.vue | 6 ++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Api/SystemController.php b/app/Http/Controllers/Api/SystemController.php index 970bbbdba..132ab4cd2 100755 --- a/app/Http/Controllers/Api/SystemController.php +++ b/app/Http/Controllers/Api/SystemController.php @@ -41,7 +41,7 @@ class SystemController extends AbstractController * @apiParam {String} type * - get: 获取(默认) * - all: 获取所有(需要管理员权限) - * - save: 保存设置(参数:['reg', 'reg_identity', 'reg_invite', 'temp_account_alias', 'login_code', 'password_policy', 'project_invite', 'chat_information', 'anon_message', 'voice2text', 'translation', 'e2e_message', 'auto_archived', 'archived_day', 'task_visible', 'task_default_time', 'all_group_mute', 'all_group_autoin', 'user_private_chat_mute', 'user_group_chat_mute', 'system_alias', 'image_compress', 'image_quality', 'image_save_local', 'start_home']) + * - save: 保存设置(参数:['reg', 'reg_identity', 'reg_invite', 'temp_account_alias', 'login_code', 'password_policy', 'project_invite', 'chat_information', 'anon_message', 'voice2text', 'translation', 'e2e_message', 'auto_archived', 'archived_day', 'task_visible', 'task_default_time', 'all_group_mute', 'all_group_autoin', 'user_private_chat_mute', 'user_group_chat_mute', 'system_alias', 'system_welcome', 'image_compress', 'image_quality', 'image_save_local', 'start_home']) * @apiSuccess {Number} ret 返回状态码(1正确、0错误) * @apiSuccess {String} msg 返回信息(错误描述) @@ -80,6 +80,7 @@ class SystemController extends AbstractController 'user_private_chat_mute', 'user_group_chat_mute', 'system_alias', + 'system_welcome', 'image_compress', 'image_quality', 'image_save_local', @@ -108,6 +109,9 @@ class SystemController extends AbstractController if ($all['system_alias'] == env('APP_NAME')) { $all['system_alias'] = ''; } + if ($all['system_welcome'] == '欢迎您,{username}') { + $all['system_welcome'] = ''; + } $setting = Base::setting('system', Base::newTrim($all)); } else { $setting = Base::setting('system'); diff --git a/resources/assets/js/pages/manage/dashboard.vue b/resources/assets/js/pages/manage/dashboard.vue index 5a1948a34..3ed78e506 100644 --- a/resources/assets/js/pages/manage/dashboard.vue +++ b/resources/assets/js/pages/manage/dashboard.vue @@ -5,7 +5,7 @@ {{warningMsg}}
-
{{$L('欢迎您,' + userInfo.nickname)}}
+
{{dashboardHello}}
{{$L('服务器时间')}}: {{$A.daytz().format('YYYY-MM-DD HH:mm:ss')}} @@ -183,6 +183,14 @@ export default { 'max-height': 'calc(100% - 50px)' } : null }, + + dashboardHello({systemConfig, userInfo}) { + let hello = '欢迎您,{username}'; + if (systemConfig.system_welcome) { + hello = systemConfig.system_welcome + } + return this.$L(hello.replace(/\{username}/g, userInfo.nickname)) + } }, watch: { diff --git a/resources/assets/js/pages/manage/setting/components/SystemSetting.vue b/resources/assets/js/pages/manage/setting/components/SystemSetting.vue index 0610199d6..b60257511 100644 --- a/resources/assets/js/pages/manage/setting/components/SystemSetting.vue +++ b/resources/assets/js/pages/manage/setting/components/SystemSetting.vue @@ -217,6 +217,12 @@
{{$L('用于网页默认标题、邮件发送等')}}
+ +
+ +
+
{{$L('仪表盘欢迎词,{username} 代表用户昵称')}}
+
{{$L('开启')}}