功能:根据友联类型排序
This commit is contained in:
@@ -25,7 +25,8 @@ 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[]);
|
||||
setLoading(false);
|
||||
|
||||
27
src/types/app/web.d.ts
vendored
27
src/types/app/web.d.ts
vendored
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user