perf: error show
This commit is contained in:
@@ -45,6 +45,11 @@ const ModelDetail = ({ modelId, isPc }: { modelId: string; isPc: boolean }) => {
|
||||
[modelDetail.userId, userInfo?._id]
|
||||
);
|
||||
|
||||
const canRead = useMemo(
|
||||
() => isOwner || isLoading || modelDetail.share.isShareDetail,
|
||||
[isLoading, isOwner, modelDetail.share.isShareDetail]
|
||||
);
|
||||
|
||||
/* 点击删除 */
|
||||
const handleDelModel = useCallback(async () => {
|
||||
if (!modelDetail) return;
|
||||
@@ -129,7 +134,7 @@ const ModelDetail = ({ modelId, isPc }: { modelId: string; isPc: boolean }) => {
|
||||
};
|
||||
}, [router]);
|
||||
|
||||
return (
|
||||
return canRead ? (
|
||||
<Box h={'100%'} p={5} overflow={'overlay'} position={'relative'}>
|
||||
{/* 头部 */}
|
||||
<Card px={6} py={3}>
|
||||
@@ -196,6 +201,10 @@ const ModelDetail = ({ modelId, isPc }: { modelId: string; isPc: boolean }) => {
|
||||
</Grid>
|
||||
<Loading loading={isLoading} fixed={false} />
|
||||
</Box>
|
||||
) : (
|
||||
<Box h={'100%'} p={5}>
|
||||
无权查看模型配置
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user