rht
This commit is contained in:
parent
7ad9db3e42
commit
096f28aa0d
|
@ -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 />
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue