From cb22fb02fd7dba5d41f202b82c1ea245984570df Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Wed, 4 Feb 2026 09:40:19 +0800 Subject: [PATCH] perf: Optimize Assistant Icon Upload Restrictions --- frontend/src/i18n/en.json | 3 ++- frontend/src/i18n/ko-KR.json | 3 ++- frontend/src/i18n/zh-CN.json | 5 +++-- frontend/src/views/system/embedded/SetUi.vue | 5 +++++ frontend/src/views/system/platform/index.vue | 2 +- 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/frontend/src/i18n/en.json b/frontend/src/i18n/en.json index bfa0bebe..4c4b933a 100644 --- a/frontend/src/i18n/en.json +++ b/frontend/src/i18n/en.json @@ -173,7 +173,8 @@ "password_reset_successful": "Password reset successful", "or": "Or", "refresh": "Refresh", - "input_limit": "Length cannot exceed {0} characters" + "input_limit": "Length cannot exceed {0} characters", + "file_size_limit_error": "File size exceeds the limit (maximum {limit})" }, "dashboard": { "open_dashboard": "Open Dashboard", diff --git a/frontend/src/i18n/ko-KR.json b/frontend/src/i18n/ko-KR.json index 8033fe34..52d890b3 100644 --- a/frontend/src/i18n/ko-KR.json +++ b/frontend/src/i18n/ko-KR.json @@ -173,7 +173,8 @@ "password_reset_successful": "비밀번호 재설정 성공", "or": "또는", "refresh": "새로고침", - "input_limit": "길이는 {0}자에서 {1}자 사이여야 합니다" + "input_limit": "길이는 {0}자에서 {1}자 사이여야 합니다", + "file_size_limit_error": "파일 크기가 제한을 초과했습니다 (최대 {limit})" }, "dashboard": { "open_dashboard": "대시보드 열기", diff --git a/frontend/src/i18n/zh-CN.json b/frontend/src/i18n/zh-CN.json index 41bf5537..919bebd4 100644 --- a/frontend/src/i18n/zh-CN.json +++ b/frontend/src/i18n/zh-CN.json @@ -173,7 +173,8 @@ "password_reset_successful": "重置密码成功", "or": "或者", "refresh": "刷新", - "input_limit": "长度在 {0} 到 {1} 个字符" + "input_limit": "长度在 {0} 到 {1} 个字符", + "file_size_limit_error": "文件大小超出限制(最大{limit})" }, "dashboard": { "open_dashboard": "打开仪表板", @@ -906,4 +907,4 @@ "to_doc": "查看 API", "trigger_limit": "最多支持创建 {0} 个 API Key" } -} \ No newline at end of file +} diff --git a/frontend/src/views/system/embedded/SetUi.vue b/frontend/src/views/system/embedded/SetUi.vue index 1ac7f138..c22cc172 100644 --- a/frontend/src/views/system/embedded/SetUi.vue +++ b/frontend/src/views/system/embedded/SetUi.vue @@ -185,6 +185,11 @@ const uploadImg = (options: any) => { } } const beforeUpload = (file: any, type: any) => { + const maxSize = 10 * 1024 * 1024 + if (file.size > maxSize) { + ElMessage.error(t('common.file_size_limit_error', { limit: '10M' })) + return false + } let len = fileList.value?.length let match = false file.flag = type diff --git a/frontend/src/views/system/platform/index.vue b/frontend/src/views/system/platform/index.vue index f4b534ba..593820fc 100644 --- a/frontend/src/views/system/platform/index.vue +++ b/frontend/src/views/system/platform/index.vue @@ -29,7 +29,7 @@ const loadData = () => { item.config = JSON.parse(item.config) return item }) - .filter((card: any) => card.type < 10) + .filter((card: any) => card.type < 9) }) } onMounted(() => {