Browse Source

fix: 添加iframe 加载失败日志

pull/236/head
cp3hnu 8 months ago
parent
commit
14a9629167
1 changed files with 8 additions and 2 deletions
  1. +8
    -2
      react-ui/src/components/IFramePage/index.tsx

+ 8
- 2
react-ui/src/components/IFramePage/index.tsx View File

@@ -83,15 +83,21 @@ function IframePage({ type, openInTab = false, className, style }: IframePagePro
requestIframeUrl();
}, [type]);

const hideLoading = () => {
const handleLoad = () => {
// setLoading(false);
Loading.hide();
};

const handleError = (error?: React.SyntheticEvent<HTMLIFrameElement, Event>) => {
// setLoading(false);
console.log('error', error);
Loading.hide();
};

return (
<div className={classNames('kf-iframe-page', className)} style={style}>
{/* {loading && createPortal(<KFSpin size="large" />, document.body)} */}
<FullScreenFrame url={iframeUrl} onLoad={hideLoading} onError={hideLoading} />
<FullScreenFrame url={iframeUrl} onLoad={handleLoad} onError={handleError} />
{openInTab && <FloatButton onClick={() => window.open(iframeUrl, '_blank')} />}
</div>
);


Loading…
Cancel
Save