部门id为0时不请求api

This commit is contained in:
禺狨 2023-04-07 15:00:25 +08:00
parent b57fdcd694
commit 9b93235ce8

View File

@ -28,6 +28,9 @@ const IndexPage = () => {
); );
useEffect(() => { useEffect(() => {
if (currentDepId === 0) {
return;
}
getData(); getData();
}, [tabKey, currentDepId]); }, [tabKey, currentDepId]);
@ -36,9 +39,6 @@ const IndexPage = () => {
}, [systemConfig]); }, [systemConfig]);
const getData = () => { const getData = () => {
if (currentDepId === 0) {
return;
}
setLoading(true); setLoading(true);
user.courses(currentDepId).then((res: any) => { user.courses(currentDepId).then((res: any) => {
const records = res.data.learn_course_records; const records = res.data.learn_course_records;