Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Open
SuperZhanggy opened this issue Mar 11, 2024 · 2 comments · May be fixed by #1237
Labels
bug Something isn't working

Comments

@SuperZhanggy
Copy link

SuperZhanggy commented Mar 11, 2024

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 SuperZhanggy added the bug Something isn't working label Mar 11, 2024
@LayGit
Copy link

LayGit commented Mar 18, 2024

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

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

@miahemu miahemu added Docker-bug bug Something isn't working and removed bug Something isn't working Docker-bug labels Apr 8, 2024
@miahemu miahemu changed the title Bug: 我用docker 部署了最新版本的chat2db,但是我看不到团队管理、权限管理功能按钮 Bug: I deployed the latest version of chat2db using docker, but I can’t see the team management and permission management function buttons Apr 8, 2024
@louis-gg
Copy link

团队管理的显示权限判断逻辑那里有点问题的,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

@miahemu miahemu added Docker-bug bug Something isn't working and removed bug Something isn't working Docker-bug labels May 13, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants