提交 91d8ca2c authored 作者: 王鹏飞's avatar 王鹏飞

fix: 修复获取用户权限逻辑,确保正确判断用户是否为编辑者

上级 8c00ed79
......@@ -115,7 +115,7 @@ const Examine = () => {
setIsAdminOrCreator(true)
return
}
void getBook({ id }).then(({ data }) => setIsAdminOrCreator(data?.user_id === userInfo.id))
void getBook({ id }).then(({ data }) => setIsAdminOrCreator(data?.editors?.includes(userInfo.id)))
}, [id, userInfo?.id, userInfo?.type])
// 获取目录结构
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论