GitHub user dosubot[bot] added a comment to the discussion: 
/superset/language_pack/zh/

<!-- Greeting -->
Hi @jiderox! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the 
superset team.

<!-- Answer -->
你遇到的 302 跳转到登录页,是因为 /superset/language_pack/zh/ 这个接口默认需要认证,嵌入式场景下没有有效的登录态或 
session,所以会被 Flask AppBuilder 
重定向到登录页(302)[参考](https://github.com/apache/superset/discussions/35099#discussioncomment-14370512)。

Superset 6.0 之后,语言包已经不再通过 /superset/language_pack/ 接口动态加载,而是直接打包进前端的 bootstrap 
数据,页面初始化时自动注入,不再需要单独请求接口[参考](https://github.com/apache/superset/discussions/34885)。如果你的嵌入式页面还在请求
 /superset/language_pack/zh/,建议:

1. 检查你的 Superset 版本和前端代码,确保用的是官方标准的 6.0+ 版本,不要再通过接口动态加载语言包。
2. 如果有自定义代码或老版本逻辑,请升级或调整,改为直接用 bootstrap 里的语言包数据。
3. 如果确实需要接口方式,必须保证嵌入页面有有效的 Superset 登录态(比如通过 guest token 认证),否则所有受保护接口都会 302 
跳转[参考](https://github.com/apache/superset/discussions/35099#discussioncomment-14370512)。

总之,推荐升级到标准用法,避免再请求 /superset/language_pack/zh/,这样嵌入式页面就能正常显示中文,无需额外认证处理。


<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*

---
<sup>How did I do? 
[Good](https://app.dosu.dev/response-feedback/8eb08746-b598-4def-b57b-5224a0d33f20?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/8eb08746-b598-4def-b57b-5224a0d33f20?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/8eb08746-b598-4def-b57b-5224a0d33f20?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/8eb08746-b598-4def-b57b-5224a0d33f20?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/8eb08746-b598-4def-b57b-5224a0d33f20?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/8eb08746-b598-4def-b57b-5224a0d33f20?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/8eb08746-b598-4def-b57b-5224a0d33f20?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat
 with 
Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github)&
 nbsp;[![Join 
Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share
 on 
X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/discussions/35864)

GitHub link: 
https://github.com/apache/superset/discussions/35864#discussioncomment-14799636

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: 
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to