rht
This commit is contained in:
parent
7ad9db3e42
commit
096f28aa0d
|
@ -11,7 +11,7 @@ export function MainLayout() {
|
||||||
<MainProvider>
|
<MainProvider>
|
||||||
<div className=" min-h-screen bg-gray-100">
|
<div className=" min-h-screen bg-gray-100">
|
||||||
<MainHeader />
|
<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 />
|
<Outlet />
|
||||||
</Content>
|
</Content>
|
||||||
<MainFooter />
|
<MainFooter />
|
||||||
|
|
|
@ -66,7 +66,7 @@ export default function MindEditor({ id }: { id?: string }) {
|
||||||
});
|
});
|
||||||
const canEdit: boolean = useMemo(() => {
|
const canEdit: boolean = useMemo(() => {
|
||||||
//登录了且是作者、超管、无id新建模式
|
//登录了且是作者、超管、无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);
|
return !Boolean(id) || isAuth || hasSomePermissions(RolePerms.MANAGE_ANY_POST);
|
||||||
}, [user])
|
}, [user])
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
|
@ -8,7 +8,7 @@ export default function CourseCard({ post }: { post: PostDto }) {
|
||||||
post={post}
|
post={post}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
navigate(`/course/${post?.id}/detail`);
|
navigate(`/course/${post?.id}/detail`);
|
||||||
|
window.scrollTo({ top: 0, behavior: "smooth" });
|
||||||
}}></PostCard>
|
}}></PostCard>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,7 @@ export default function PathCard({ post }: { post: PostDto }) {
|
||||||
post={post}
|
post={post}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
navigate(`/path/editor/${post?.id}`);
|
navigate(`/path/editor/${post?.id}`);
|
||||||
|
window.scrollTo({ top: 0, behavior: "smooth" });
|
||||||
}}></PostCard>
|
}}></PostCard>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue