feat: admin set share

This commit is contained in:
archer
2023-06-14 23:37:05 +08:00
parent c6259fca78
commit bf1592d2c6
7 changed files with 77 additions and 26 deletions

View File

@@ -77,7 +77,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse<
}
},
{
$sort: { 'share.collection': -1 }
$sort: { 'share.topNum': -1, 'share.collection': -1 }
},
{
$skip: (pageNum - 1) * pageSize

View File

@@ -344,7 +344,7 @@ ${e.password ? `密码为: ${e.password}` : ''}`;
{isOwner && (
<>
{/* model share setting */}
<Card p={4}>
{/* <Card p={4}>
<Box fontWeight={'bold'}>分享设置</Box>
<Box>
<Flex mt={5} alignItems={'center'}>
@@ -373,7 +373,7 @@ ${e.password ? `密码为: ${e.password}` : ''}`;
/>
</Box>
</Box>
</Card>
</Card> */}
<Card p={4}>
<Flex justifyContent={'space-between'}>
<Box fontWeight={'bold'}></Box>
@@ -411,7 +411,7 @@ ${e.password ? `密码为: ${e.password}` : ''}`;
</>
)}
{/* shareChat */}
<Card p={4} gridColumnStart={1} gridColumnEnd={[2, 3]}>
<Card p={4}>
<Flex justifyContent={'space-between'}>
<Box fontWeight={'bold'}>

View File

@@ -61,6 +61,10 @@ const ModelSchema = new Schema({
}
},
share: {
topNum: {
type: Number,
default: 0
},
isShare: {
type: Boolean,
default: false