|
@@ -86,10 +86,6 @@ const DocumentDetail: FC<Props> = ({ datasetId, documentId }) => {
|
|
|
const { notify } = useContext(ToastContext)
|
|
|
const { dataset } = useDatasetDetailContext()
|
|
|
const { isCreate, isEdit, isOperation } = GetDatasetAuth(dataset)
|
|
|
- if (!isOperation) {
|
|
|
- notify({ type: 'warning', message: '暂无权限!' })
|
|
|
- router.replace(`/datasets/${datasetId}/documents`)
|
|
|
- }
|
|
|
const embeddingAvailable = !!dataset?.embedding_available
|
|
|
const [showMetadata, setShowMetadata] = useState(!isMobile)
|
|
|
const [newSegmentModalVisible, setNewSegmentModalVisible] = useState(false)
|
|
@@ -140,6 +136,13 @@ const DocumentDetail: FC<Props> = ({ datasetId, documentId }) => {
|
|
|
params: { metadata: 'without' },
|
|
|
})
|
|
|
|
|
|
+ if (documentDetail) {
|
|
|
+ if (!(isOperation && (documentDetail.check_status === 2 || documentDetail.check_status === 3))) {
|
|
|
+ notify({ type: 'warning', message: '暂无权限!' })
|
|
|
+ router.replace(`/datasets/${datasetId}/documents`)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
const { data: documentMetadata, error: metadataErr, refetch: metadataMutate } = useDocumentMetadata({
|
|
|
datasetId,
|
|
|
documentId,
|