diff --git a/src/pages/course/index.tsx b/src/pages/course/index.tsx index b071e7a..23dfe08 100644 --- a/src/pages/course/index.tsx +++ b/src/pages/course/index.tsx @@ -145,7 +145,15 @@ const CoursePage = () => { navigate(-1)} + onClick={() => { + if (window.history.length <= 1) { + // 将页面跳转到首页 + navigate("/"); + } else { + // 返回到前一个页面 + navigate(-1); + } + }} />