From 257609df5feac2be0081e7e383f2d02caddb5c68 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Tue, 29 Jul 2025 11:15:30 +0800 Subject: [PATCH] perf: Assistant domain check --- frontend/src/i18n/en.json | 5 +++-- frontend/src/i18n/zh-CN.json | 5 +++-- frontend/src/views/system/embedded/index.vue | 5 +++++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/frontend/src/i18n/en.json b/frontend/src/i18n/en.json index e7645eb2..ddbe077a 100644 --- a/frontend/src/i18n/en.json +++ b/frontend/src/i18n/en.json @@ -472,7 +472,8 @@ "duplicate_email": "Duplicate email", "interface_credentials": "Interface credentials", "no_credentials_yet": "No credentials yet", - "intelligent_customer_service": "SQLBot Intelligent Customer Service" + "intelligent_customer_service": "SQLBot Intelligent Customer Service", + "origin_format_error": "Format invalid, starts with http or https and cannot end with /" }, "chat": { "type": "Chart Type", @@ -518,4 +519,4 @@ "back_community": "Restore to Community Edition", "confirm_tips": "Are you sure to restore to Community Edition?" } -} \ No newline at end of file +} diff --git a/frontend/src/i18n/zh-CN.json b/frontend/src/i18n/zh-CN.json index ce571212..8d5014db 100644 --- a/frontend/src/i18n/zh-CN.json +++ b/frontend/src/i18n/zh-CN.json @@ -487,7 +487,8 @@ "stop_replying": "停止回答", "i_am_sqlbot": "你好,我是 SQLBot", "predict_data_etc": "我可以查询数据、生成图表、检测数据异常、预测数据等", - "intelligent_data_query": "赶快开启智能问数吧~" + "intelligent_data_query": "赶快开启智能问数吧~", + "origin_format_error": "格式错误,http或https开头,不能以 / 结尾" }, "chat": { "type": "图表类型", @@ -533,4 +534,4 @@ "back_community": "还原至社区版", "confirm_tips": "确定还原至社区版?" } -} \ No newline at end of file +} diff --git a/frontend/src/views/system/embedded/index.vue b/frontend/src/views/system/embedded/index.vue index 39c4f9b0..cead4863 100644 --- a/frontend/src/views/system/embedded/index.vue +++ b/frontend/src/views/system/embedded/index.vue @@ -245,6 +245,11 @@ const rules = { t('datasource.please_enter') + t('common.empty') + t('embedded.cross_domain_settings'), trigger: 'blur', }, + { + pattern: /^(https?:\/\/)?([\w-]+\.)*[\w-]+(:\d+)?$/, + message: t('embedded.origin_format_error'), + trigger: 'blur', + }, ], }