mirror of
https://github.com/PlayEdu/frontend.git
synced 2025-06-28 15:56:32 +08:00
部门id为0时不请求api
This commit is contained in:
parent
b57fdcd694
commit
9b93235ce8
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user