功能:根据友联类型排序

This commit is contained in:
宇阳
2024-11-22 15:44:18 +08:00
parent a77cf4d91b
commit bb2d4fdeec
2 changed files with 16 additions and 14 deletions

View File

@@ -25,6 +25,7 @@ const LinkPage = () => {
const getLinkList = async () => {
const { data } = await getLinkListAPI();
data.sort((a, b) => a.order - b.order)
data.sort((a, b) => a.type.order - b.type.order)
setList(data as Web[]);
setListTemp(data as Web[]);

View File

@@ -1,19 +1,20 @@
export interface LinkType {
id: number,
name: string
name: string,
order: number
}
export interface Web {
id: number;
title: string;
description: string;
email: string;
image: string;
url: string;
rss: string;
order: number;
typeId: number;
type: LinkType;
auditStatus: number;
createTime?: string;
id: number,
title: string,
description: string,
email: string,
image: string,
url: string,
rss: string,
order: number,
typeId: number,
type: LinkType,
auditStatus: number,
createTime?: string
}