[Bug] 网页版 mineru.net 登录后 token 不生效:任务管理/API Token 页面陷入登录循环(登录状态无法在网页端保持)
Author: stelveticaCreated Aug 14, 2026Updated Sep 6, 2026
Labelsbug
问题现象 / Description
MinerU 网页版(https://mineru.net)存在**登录死循环**,两个页面均可复现:
- https://mineru.net/OpenSourceTools/Extractor(在线文档解析)
- https://mineru.net/apiManage/token(API Token 管理)
复现步骤:
- 未登录状态打开上述任一页面,点击「任务管理」(或进入 token 页面)。
- 页面跳转到 SSO 登录页:
https://sso.openxlab.org.cn/mineru-login?redirect=https://mineru.net/OpenSourceTools/Extractor?clientId=4m2wonemkv2rm37nwen8&source=minerU(token 页的 clientId 为lkzdx57nvy22jkpq9x2w)。 - 完成登录后,页面重定向回 mineru.net 目标页。
- 但页面仍显示未登录,点击「任务管理」再次跳转到 SSO 登录页,重复登录后依旧循环。
即:登录状态在网页版无法生效,陷入「点击 → 登录 → 跳转回 → 仍要求登录」的无限循环。
同样现象也出现在 https://mineru.net/apiManage/token 页面。
技术分析 / Root cause analysis(供排查参考)
通过浏览器反编译 SSO 登录脚本(sso.openxlab.org.cn/static/js/main.613bba76.chunk.js)分析,疑似根因如下:
- SSO 登录成功后,
uaa-token只写入sso.openxlab.org.cn域下的 Cookie(document.cookie匹配/uaa-token=[^;]*/),随后整页重定向回mineru.net。 - 由于浏览器跨域隔离,
mineru.net域读取不到sso.openxlab.org.cn域写入的 token Cookie。 - mineru.net 前端通过
GET https://mineru.net/datasets/api/v2/users/current校验登录态,未登录时该接口返回 HTTP 200 但data.id == 0(游客态),前端据此判定未登录。 - 于是页面再次触发跳转到 SSO → 登录 → 跳转回 → 仍读不到 token → 死循环。
另外注意到 SSO 的 postMessage 回传白名单目前仅包含 chat.intern-ai.org.cn、intern.openxlab.org.cn、localhost:8081,不含 mineru.net。GitHub/微信 第三方登录走 popup + window.opener.postMessage 回传 token 的方式,mineru.net 不在白名单中,也可能导致 token 无法回传。
期望行为 / Expected behavior
- 登录成功后,登录状态应在 mineru.net 网页版持久生效,「任务管理」「API Token」页面可直接访问,不应再次跳转登录。
环境信息 / Environment
- 操作系统:Windows 11
- 浏览器:Chrome(最新稳定版),已开启第三方 Cookie
- 场景:MinerU 网页版在线服务(非本地库),上述问题与本地 MinerU 版本无关
相关截图/日志: 未登录时 GET https://mineru.net/datasets/api/v2/users/current 返回:
{"code":200,"msg":"ok","data":{"id":0,"name":null,"email":null,"phone":null,"githubAccount":null,"role":"","organization":null,"wechatAccount":null,"zhihuAccount":null,"isInternal":false,"ssoUid":null,"nickname":null,"avatar":null,"isNewUser":false}}
Source: opendatalab/MinerU