Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

登录页面无限重定向 #69

Closed
janusda opened this issue Aug 24, 2023 · 3 comments
Closed

登录页面无限重定向 #69

janusda opened this issue Aug 24, 2023 · 3 comments

Comments

@janusda
Copy link

janusda commented Aug 24, 2023

服务端设置 AnonymousAccess.PromQuerier=false时, 进入登录页面, 出现不停重定向到登录页的情况.
发现是登录页调用/api/n9e/datasource/brief, 返回401后重定向到登录页
image
image

@jsers
Copy link
Collaborator

jsers commented Aug 24, 2023 via email

@janusda
Copy link
Author

janusda commented Aug 25, 2023

后端项目我也看过了, 因为不需要匿名datasource接口, 这个配置下返回401是正常的.
我目前的解决方案是在
App.tsx useEffect里修改 const datasourceList = isLoginPage ? [] : await getDatasourceBriefList();,
重新构建就正常了.
(ps: 上面第二张贴图代码是我修改过的, "if (location.pathname == '/login') " 原本代码是没有, 我截错图了)

@janusda
Copy link
Author

janusda commented Aug 25, 2023

这个似乎不是前端项目问题 可以在 https://github.com/ccfos/nightingale/issues 这里提下 Janus @.> 于2023年8月24日周四 11:38写道:

后端 AnonymousAccess.PromQuerier=false, — Reply to this email directly, view it on GitHub <#69>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABYUU6UNWCDWMGKT5E5DBK3XW3ECZANCNFSM6AAAAAA34L5C2I . You are receiving this because you are subscribed to this thread.Message ID: @.
>

登录页面不需要拉取 /api/n9e/datasource/brief的接口, 但目前登录页面都会调用到useEffect函数, 里面就会引用到该接口

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants