feat: support DeepSeek (#667)

### What problem does this PR solve?

#666 
feat: support DeepSeek
feat: preview word and excel

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2024-05-08 10:30:18 +08:00
committed by GitHub
parent eb27a4309e
commit a553dc8dbd
17 changed files with 1922 additions and 109 deletions

View File

@@ -0,0 +1,28 @@
import { api_host } from '@/utils/api';
import FileViewer from 'react-file-viewer';
import { useParams, useSearchParams } from 'umi';
import Excel from './excel';
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 onError = (e: any) => {
console.error(e, 'error in file-viewer');
};
return (
<section className={styles.viewerWrapper}>
{ext === 'xlsx' && <Excel filePath={api}></Excel>}
{ext !== 'xlsx' && (
<FileViewer fileType={ext} filePath={api} onError={onError} />
)}
</section>
);
};
export default DocumentViewer;