线上课学员、学员学习学习进度左侧菜单高亮

This commit is contained in:
禺狨 2023-05-08 14:09:18 +08:00
parent a34a2ccae8
commit 71c0f03be4

View File

@ -119,8 +119,16 @@ export const LeftMenu: React.FC = () => {
};
useEffect(() => {
setSelectedKeys([location.pathname]);
setOpenKeys(openKeyMerge(location.pathname));
if (location.pathname.indexOf("/course/user") !== -1) {
setSelectedKeys(["/course"]);
setOpenKeys(openKeyMerge("/course"));
} else if (location.pathname.indexOf("/member/learn") !== -1) {
setSelectedKeys(["/member/index"]);
setOpenKeys(openKeyMerge("/member/index"));
} else {
setSelectedKeys([location.pathname]);
setOpenKeys(openKeyMerge(location.pathname));
}
}, [location.pathname]);
return (