...
|
...
|
@@ -8,6 +8,8 @@ interface pdfPreviewProps { |
8
|
8
|
const pdfPreview = (props: pdfPreviewProps) => {
|
9
|
9
|
const [filePath, setFilePath] = useState<string>();
|
10
|
10
|
|
|
11
|
+ const _origin = window.location.origin;
|
|
12
|
+
|
11
|
13
|
useEffect(()=>{
|
12
|
14
|
if (props.url) {
|
13
|
15
|
const _url = encodeURIComponent(props.url);
|
...
|
...
|
@@ -20,7 +22,7 @@ const pdfPreview = (props: pdfPreviewProps) => { |
20
|
22
|
<iframe
|
21
|
23
|
title="pdf-preview"
|
22
|
24
|
style={{ width: '100%', height: '100%' }}
|
23
|
|
- src={`https://h5jianke.21tb.com/file/generic_mobile/web/viewer.html?file=${filePath}`}
|
|
25
|
+ src={`${_origin}/pdf/web/viewer.html?file=${filePath}`}
|
24
|
26
|
/>
|
25
|
27
|
</div>
|
26
|
28
|
);
|
...
|
...
|
|