diff --git a/src/views/Course/index.tsx b/src/views/Course/index.tsx index cf5add3..31a1f48 100644 --- a/src/views/Course/index.tsx +++ b/src/views/Course/index.tsx @@ -10,6 +10,7 @@ import slide from "../../assets/icons/slide.png"; import play from "../../assets/icons/play.png"; import bookmark from "../../assets/icons/bookmark.png"; import StyledRating from "../../components/StyledRating"; +import location from "../../util/location"; import { connect } from "react-redux"; import { publicApi } from "../../redux/actions"; import scroll from "../../util/scroll"; @@ -25,19 +26,14 @@ function Course({ getInfo, info, categories, loading }: any) { useEffect(() => { scroll.goToTop(); getInfo({ - bookId: 18, - // window.location.pathname.slice( - // window.location.pathname.lastIndexOf("/") + 1, - // window.location.pathname.length - // ), + bookId: location.getId() }); }, []); const checkFreeCat = () => { const freeCat = info?.vods.filter((item: any) => item?.isFreeVOD)[0]; - localStorage.setItem("free", 1 + "," + freeCat?.categoryId); + localStorage.setItem("free", location.getId() + "," + freeCat?.categoryId); }; - return (
{loading && ( -