个人信息修改和切花部门

This commit is contained in:
禺狨
2023-03-27 12:15:31 +08:00
parent e1ce7d8b47
commit 987c6e21ec
6 changed files with 141 additions and 35 deletions

View File

@@ -19,14 +19,17 @@ const IndexPage = () => {
const departments = useSelector(
(state: any) => state.loginUser.value.departments
);
const currentDepId = useSelector(
(state: any) => state.loginUser.value.currentDepId
);
useEffect(() => {
getData();
}, [tabKey]);
}, [tabKey, currentDepId]);
const getData = () => {
setLoading(true);
user.courses(departments[0].id).then((res: any) => {
user.courses(currentDepId).then((res: any) => {
const records = res.data.learn_course_records;
setStats(res.data.stats);
setLearnCourseRecords(records);