diff --git a/src/renderers/IFrame.tsx b/src/renderers/IFrame.tsx index ca6ad21b7..c2de8de25 100644 --- a/src/renderers/IFrame.tsx +++ b/src/renderers/IFrame.tsx @@ -157,6 +157,16 @@ export default class IFrame extends React.Component { ...tempStyle, ...style }; + + const finalSrc = src ? buildApi(src, data).url : undefined; + + if ( + typeof finalSrc === 'string' && + !/^(\.\/|\.\.\/|\/|https?\:\/\/)/.test(finalSrc) + ) { + return

请填写合法的 iframe 地址

; + } + return (