support new htmlUrl
parent
13dbe2c784
commit
dea09d52cf
|
@ -54,6 +54,7 @@ function DeviceFrame(props) {
|
|||
var [config, setConfig] = useState({})
|
||||
var [cacheKey, setCacheKey] = useState(new Date().getTime());
|
||||
var [openPopup, setOpenPopup] = useState(false);
|
||||
var [absoluteUrl, setAbsoluteUrl] = useState('');
|
||||
|
||||
useEffect(() => {
|
||||
setConfig(configMap[props.device])
|
||||
|
@ -63,7 +64,8 @@ function DeviceFrame(props) {
|
|||
|
||||
useEffect(() => {
|
||||
console.log('触发更新', props.htmlUrl);
|
||||
refresh();
|
||||
setAbsoluteUrl(!props.htmlUrl?.startsWith("http") ? BaseUrl + props.htmlUrl : props.htmlUrl);
|
||||
refresh()
|
||||
props.refreshQrCode()
|
||||
}, [props.htmlUrl])
|
||||
|
||||
|
@ -73,7 +75,7 @@ function DeviceFrame(props) {
|
|||
{ props.qrDataUrl &&
|
||||
<div className='qrCode'>
|
||||
<p style={{ margin: '0' }}>扫一扫,手机预览
|
||||
<CopyToClipboard text={BaseUrl + props.htmlUrl} onCopy={() => setOpenPopup(true)}>
|
||||
<CopyToClipboard text={absoluteUrl} onCopy={() => setOpenPopup(true)}>
|
||||
<img style={{ cursor: 'pointer', width: '20px', height: '20px' }} src={copyPng} alt='复制链接'/>
|
||||
</CopyToClipboard>
|
||||
</p>
|
||||
|
@ -102,7 +104,7 @@ function DeviceFrame(props) {
|
|||
paddingBottom: config.offsetv
|
||||
}}
|
||||
title='preview'
|
||||
src={baseUrl + props.htmlUrl + '?cacheKey=' + cacheKey}
|
||||
src={absoluteUrl + '?cacheKey=' + cacheKey}
|
||||
width={config.width}
|
||||
height={config.height}
|
||||
frameBorder={'0'}/>
|
||||
|
|
Loading…
Reference in New Issue