From 5d8619450df551a0ba942cb4e846b8449e46dc68 Mon Sep 17 00:00:00 2001 From: zyc <1439655764@qq.com> Date: Tue, 24 Feb 2026 13:01:23 +0800 Subject: [PATCH] fix(log-center): add repo_url and make log center URL configurable Co-Authored-By: Claude Opus 4.6 --- .../lib/core/services/log_center_service.dart | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/airhub_app/lib/core/services/log_center_service.dart b/airhub_app/lib/core/services/log_center_service.dart index 192cab2..d22cc2b 100644 --- a/airhub_app/lib/core/services/log_center_service.dart +++ b/airhub_app/lib/core/services/log_center_service.dart @@ -11,9 +11,13 @@ LogCenterService logCenterService(Ref ref) { } class LogCenterService { - static const String _url = - 'https://qiyuan-log-center-api.airlabs.art/api/v1/logs/report'; + static const String _baseUrl = String.fromEnvironment( + 'LOG_CENTER_URL', + defaultValue: 'https://qiyuan-log-center-api.airlabs.art', + ); + static const String _url = '$_baseUrl/api/v1/logs/report'; static const String _projectId = 'airhub_app'; + static const String _repoUrl = 'https://gitea.airlabs.art/zyc/rtc_prd.git'; late final Dio _dio; @@ -88,8 +92,12 @@ class LogCenterService { final payload = { 'project_id': _projectId, - 'environment': kDebugMode ? 'development' : 'production', + 'environment': const String.fromEnvironment( + 'ENVIRONMENT', + defaultValue: kDebugMode ? 'development' : 'production', + ), 'level': 'ERROR', + 'repo_url': _repoUrl, 'error': { 'type': errorType, 'message': message.length > 2000 ? message.substring(0, 2000) : message,