From a77cf4d91bc8603145ba914b266803d92db5cfb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=87=E9=98=B3?= Date: Fri, 22 Nov 2024 15:34:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=9F=E8=83=BD=EF=BC=9A=E5=88=86=E7=B1=BB&?= =?UTF-8?q?=E5=8F=8B=E8=81=94=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Cate/index.tsx | 2 ++ src/pages/Web/index.tsx | 8 +++++++- src/types/app/web.d.ts | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/pages/Cate/index.tsx b/src/pages/Cate/index.tsx index 2524bf9..b5c8c98 100644 --- a/src/pages/Cate/index.tsx +++ b/src/pages/Cate/index.tsx @@ -19,6 +19,8 @@ const CatePage = () => { const getCateList = async () => { const { data } = await getCateListAPI(); + data.sort((a, b) => a.order - b.order) + setList(data as Cate[]); setLoading(false); }; diff --git a/src/pages/Web/index.tsx b/src/pages/Web/index.tsx index c5f0e80..c4677d8 100644 --- a/src/pages/Web/index.tsx +++ b/src/pages/Web/index.tsx @@ -24,6 +24,8 @@ const LinkPage = () => { // 获取网站列表 const getLinkList = async () => { const { data } = await getLinkListAPI(); + data.sort((a, b) => a.order - b.order) + setList(data as Web[]); setListTemp(data as Web[]); setLoading(false); @@ -148,7 +150,7 @@ const LinkPage = () => { } ) : ( - + )} @@ -193,6 +195,10 @@ const LinkPage = () => { + + + + diff --git a/src/types/app/web.d.ts b/src/types/app/web.d.ts index e8a08aa..bde805a 100644 --- a/src/types/app/web.d.ts +++ b/src/types/app/web.d.ts @@ -11,6 +11,7 @@ export interface Web { image: string; url: string; rss: string; + order: number; typeId: number; type: LinkType; auditStatus: number;