From c6e0b5a1e7ae197129366ccfa9a5e8c39ba2cca7 Mon Sep 17 00:00:00 2001 From: heheer Date: Sat, 17 May 2025 22:03:18 +0800 Subject: [PATCH] offiaccount welcome text (#4827) * offiaccount welcome text * fix * Update Image.tsx --------- Co-authored-by: Archer <545436317@qq.com> --- packages/web/i18n/en/common.json | 1 + packages/web/i18n/zh-CN/common.json | 1 + packages/web/i18n/zh-Hant/common.json | 1 + projects/app/src/components/Markdown/img/Image.tsx | 7 +++++++ 4 files changed, 10 insertions(+) diff --git a/packages/web/i18n/en/common.json b/packages/web/i18n/en/common.json index 1cf0ac0d1..640e8fdb6 100644 --- a/packages/web/i18n/en/common.json +++ b/packages/web/i18n/en/common.json @@ -923,6 +923,7 @@ "not_open": "Not Open", "not_permission": "The current subscription package does not support team operation logs", "not_support": "Not Supported", + "not_support_wechat_image": "WeChat image rendering is not supported", "not_yet_introduced": "No Introduction Yet", "open_folder": "Open Folder", "option": "Option", diff --git a/packages/web/i18n/zh-CN/common.json b/packages/web/i18n/zh-CN/common.json index e86f18daf..c1fc79bfd 100644 --- a/packages/web/i18n/zh-CN/common.json +++ b/packages/web/i18n/zh-CN/common.json @@ -922,6 +922,7 @@ "not_open": "未开启", "not_permission": "当前订阅套餐不支持团队操作日志", "not_support": "不支持", + "not_support_wechat_image": "暂时不支持微信图片渲染", "not_yet_introduced": "暂无介绍", "open_folder": "打开文件夹", "option": "选项", diff --git a/packages/web/i18n/zh-Hant/common.json b/packages/web/i18n/zh-Hant/common.json index ad59164d9..057ef5e3f 100644 --- a/packages/web/i18n/zh-Hant/common.json +++ b/packages/web/i18n/zh-Hant/common.json @@ -922,6 +922,7 @@ "not_open": "未開啟", "not_permission": "當前訂閱套餐不支持團隊操作日誌", "not_support": "不支援", + "not_support_wechat_image": "暫時不支持微信圖片渲染", "not_yet_introduced": "暫無介紹", "open_folder": "開啟資料夾", "option": "選項", diff --git a/projects/app/src/components/Markdown/img/Image.tsx b/projects/app/src/components/Markdown/img/Image.tsx index b83b15676..ea5eb8247 100644 --- a/projects/app/src/components/Markdown/img/Image.tsx +++ b/projects/app/src/components/Markdown/img/Image.tsx @@ -2,8 +2,10 @@ import React, { useState } from 'react'; import { Box, type ImageProps, Skeleton } from '@chakra-ui/react'; import MyPhotoView from '@fastgpt/web/components/common/Image/PhotoView'; import { useBoolean } from 'ahooks'; +import { useTranslation } from 'next-i18next'; const MdImage = ({ src, ...props }: { src?: string } & ImageProps) => { + const { t } = useTranslation(); const [isLoaded, { setTrue }] = useBoolean(false); const [renderSrc, setRenderSrc] = useState(src); @@ -11,6 +13,11 @@ const MdImage = ({ src, ...props }: { src?: string } & ImageProps) => { if (src?.includes('base64') && !src.startsWith('data:image')) { return Invalid base64 image; } + + if (props.alt?.startsWith('OFFIACCOUNT_MEDIA')) { + return {t('common:not_support_wechat_image')}; + } + return (