diff --git a/src/compenents/left-menu/index.tsx b/src/compenents/left-menu/index.tsx index 07d4b24..ccfe912 100644 --- a/src/compenents/left-menu/index.tsx +++ b/src/compenents/left-menu/index.tsx @@ -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 (