File tree Expand file tree Collapse file tree 4 files changed +10
-0
lines changed
projects/app/src/components/Markdown/img Expand file tree Collapse file tree 4 files changed +10
-0
lines changed Original file line number Diff line number Diff line change 923
923
"not_open" : " Not Open" ,
924
924
"not_permission" : " The current subscription package does not support team operation logs" ,
925
925
"not_support" : " Not Supported" ,
926
+ "not_support_wechat_image" : " WeChat image rendering is not supported" ,
926
927
"not_yet_introduced" : " No Introduction Yet" ,
927
928
"open_folder" : " Open Folder" ,
928
929
"option" : " Option" ,
Original file line number Diff line number Diff line change 922
922
"not_open" : " 未开启" ,
923
923
"not_permission" : " 当前订阅套餐不支持团队操作日志" ,
924
924
"not_support" : " 不支持" ,
925
+ "not_support_wechat_image" : " 暂时不支持微信图片渲染" ,
925
926
"not_yet_introduced" : " 暂无介绍" ,
926
927
"open_folder" : " 打开文件夹" ,
927
928
"option" : " 选项" ,
Original file line number Diff line number Diff line change 922
922
"not_open" : " 未開啟" ,
923
923
"not_permission" : " 當前訂閱套餐不支持團隊操作日誌" ,
924
924
"not_support" : " 不支援" ,
925
+ "not_support_wechat_image" : " 暫時不支持微信圖片渲染" ,
925
926
"not_yet_introduced" : " 暫無介紹" ,
926
927
"open_folder" : " 開啟資料夾" ,
927
928
"option" : " 選項" ,
Original file line number Diff line number Diff line change @@ -2,15 +2,22 @@ import React, { useState } from 'react';
2
2
import { Box , type ImageProps , Skeleton } from '@chakra-ui/react' ;
3
3
import MyPhotoView from '@fastgpt/web/components/common/Image/PhotoView' ;
4
4
import { useBoolean } from 'ahooks' ;
5
+ import { useTranslation } from 'next-i18next' ;
5
6
6
7
const MdImage = ( { src, ...props } : { src ?: string } & ImageProps ) => {
8
+ const { t } = useTranslation ( ) ;
7
9
const [ isLoaded , { setTrue } ] = useBoolean ( false ) ;
8
10
9
11
const [ renderSrc , setRenderSrc ] = useState ( src ) ;
10
12
11
13
if ( src ?. includes ( 'base64' ) && ! src . startsWith ( 'data:image' ) ) {
12
14
return < Box > Invalid base64 image</ Box > ;
13
15
}
16
+
17
+ if ( props . alt ?. startsWith ( 'OFFIACCOUNT_MEDIA' ) ) {
18
+ return < Box > { t ( 'common:not_support_wechat_image' ) } </ Box > ;
19
+ }
20
+
14
21
return (
15
22
< Skeleton isLoaded = { isLoaded } >
16
23
< MyPhotoView
You can’t perform that action at this time.
0 commit comments