This commit is contained in:
Rao 2025-02-27 19:17:23 +08:00
parent 7ad9db3e42
commit 096f28aa0d
4 changed files with 4 additions and 3 deletions

View File

@ -11,7 +11,7 @@ export function MainLayout() {
<MainProvider>
<div className=" min-h-screen bg-gray-100">
<MainHeader />
<Content className="min-h-screen flex-grow pt-12 bg-gray-50 ">
<Content className="min-h-screen flex-grow pt-14 bg-gray-50 ">
<Outlet />
</Content>
<MainFooter />

View File

@ -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();

View File

@ -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" });
}}></PostCard>
);
}

View File

@ -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" });
}}></PostCard>
);
}