Chat2DB icon indicating copy to clipboard operation
Chat2DB copied to clipboard

Bug: I deployed the latest version of chat2db using docker, but I can’t see the team management and permission management function buttons

Open SuperZhanggy opened this issue 1 year ago • 2 comments

Chat2DB Version

3.1.19

Describe the bug

I want to try chat2db's permission management, team management and operation log functions, but I can't find these buttons after deploying with docker

SuperZhanggy avatar Mar 11 '24 02:03 SuperZhanggy

团队管理的显示权限判断逻辑那里有点问题的,userInfo 是异步获取的,但是判定逻辑只会在 mount 的时候执行一次,所以判定的时候 userInfo 的值是 null,然后就不会显示团队管理那个图标按钮了,你可以在 url 路径后面直接拼 /team 试试

https://github.com/chat2db/Chat2DB/blob/c8f54daf039899217e021a0f2037356fd37ec6ab/chat2db-client/src/pages/main/index.tsx#L125C3-L144C5

LayGit avatar Mar 18 '24 14:03 LayGit

团队管理的显示权限判断逻辑那里有点问题的,userInfo 是异步获取的,但是判定逻辑只会在 mount 的时候执行一次,所以判定的时候 userInfo 的值是 null,然后就不会显示团队管理那个图标按钮了,你可以在 url 路径后面直接拼 /team 试试

https://github.com/chat2db/Chat2DB/blob/c8f54daf039899217e021a0f2037356fd37ec6ab/chat2db-client/src/pages/main/index.tsx#L125C3-L144C5

这种方法并不能修复该问题,因为 setNavConfig([...cloneNavConfig]),后navConfig定义的const,因此依然是initNavConfig,这也是不显示的原因。 我的修复方法是,定义两个initNavConfig,根据登录用户信息选择初始化。 因为我接触js不多,所以代码不敢合入,看是否有用,如果有用,请根据以上思路修复。 image

louis-gg avatar Apr 10 '24 02:04 louis-gg