fix: reference file with 'docx' type can not open #844 (#1635)

### What problem does this PR solve?

fix: reference file with 'docx' type can not open #844

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
balibabu
2024-07-22 15:54:15 +08:00
committed by GitHub
parent 29a7b7a040
commit cf12c3cc1f
6 changed files with 52 additions and 24 deletions

View File

@ -12,9 +12,10 @@ import styles from './index.less';
const DocumentViewer = () => {
const { id: documentId } = useParams();
const api = `${api_host}/file/get/${documentId}`;
const [currentQueryParameters] = useSearchParams();
const ext = currentQueryParameters.get('ext');
const prefix = currentQueryParameters.get('prefix');
const api = `${api_host}/${prefix || 'file'}/get/${documentId}`;
return (
<section className={styles.viewerWrapper}>