diff --git a/apps/web/src/app/main/layout/MainLayout.tsx b/apps/web/src/app/main/layout/MainLayout.tsx index fa6627a..739bcaa 100755 --- a/apps/web/src/app/main/layout/MainLayout.tsx +++ b/apps/web/src/app/main/layout/MainLayout.tsx @@ -11,7 +11,7 @@ export function MainLayout() {
- + diff --git a/apps/web/src/components/common/editor/MindEditor.tsx b/apps/web/src/components/common/editor/MindEditor.tsx index b1d4a39..88d745b 100755 --- a/apps/web/src/components/common/editor/MindEditor.tsx +++ b/apps/web/src/components/common/editor/MindEditor.tsx @@ -66,7 +66,7 @@ export default function MindEditor({ id }: { id?: string }) { }); const canEdit: boolean = useMemo(() => { //登录了且是作者、超管、无id新建模式 - const isAuth = isAuthenticated && user?.id == post?.authorId; + const isAuth = isAuthenticated && user?.id == post?.author.id return !Boolean(id) || isAuth || hasSomePermissions(RolePerms.MANAGE_ANY_POST); }, [user]) const navigate = useNavigate(); diff --git a/apps/web/src/components/models/post/SubPost/CourseCard.tsx b/apps/web/src/components/models/post/SubPost/CourseCard.tsx index 25ce782..6140607 100644 --- a/apps/web/src/components/models/post/SubPost/CourseCard.tsx +++ b/apps/web/src/components/models/post/SubPost/CourseCard.tsx @@ -8,7 +8,7 @@ export default function CourseCard({ post }: { post: PostDto }) { post={post} onClick={() => { navigate(`/course/${post?.id}/detail`); - + window.scrollTo({ top: 0, behavior: "smooth" }); }}> ); } diff --git a/apps/web/src/components/models/post/SubPost/PathCard.tsx b/apps/web/src/components/models/post/SubPost/PathCard.tsx index c6e5a85..9de4ed0 100644 --- a/apps/web/src/components/models/post/SubPost/PathCard.tsx +++ b/apps/web/src/components/models/post/SubPost/PathCard.tsx @@ -9,6 +9,7 @@ export default function PathCard({ post }: { post: PostDto }) { post={post} onClick={() => { navigate(`/path/editor/${post?.id}`); + window.scrollTo({ top: 0, behavior: "smooth" }); }}> ); }