From 9b93235ce80ba7ef1e7bee233450b39bf4eed574 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A6=BA=E7=8B=A8?= <18119604035@163.com> Date: Fri, 7 Apr 2023 15:00:25 +0800 Subject: [PATCH] =?UTF-8?q?=E9=83=A8=E9=97=A8id=E4=B8=BA0=E6=97=B6?= =?UTF-8?q?=E4=B8=8D=E8=AF=B7=E6=B1=82api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/index/index.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/index/index.tsx b/src/pages/index/index.tsx index 825dd84..3308fda 100644 --- a/src/pages/index/index.tsx +++ b/src/pages/index/index.tsx @@ -28,6 +28,9 @@ const IndexPage = () => { ); useEffect(() => { + if (currentDepId === 0) { + return; + } getData(); }, [tabKey, currentDepId]); @@ -36,9 +39,6 @@ const IndexPage = () => { }, [systemConfig]); const getData = () => { - if (currentDepId === 0) { - return; - } setLoading(true); user.courses(currentDepId).then((res: any) => { const records = res.data.learn_course_records;