fix(web): access token 移出 localStorage;401 刷新 single-flight 并跳登录页
- access token 只存内存:XSS 拿不到持久凭据;刷新页面由 bootstrap 用 HttpOnly refresh cookie 静默换新;bootstrap 并发去重 - 并发 401 共享一次刷新(refresh 已是轮换式,各自刷新会互相踩);会话失效自动回登录页 - 防主题闪烁内联脚本挪到外部 theme-init.js(配合 CSP script-src 'self') - 修 console 用量页与管理用户搜索的查询参数未编码;极小金额不再显示科学计数法;渠道表单数字输入清空后省略字段而非提交 0(权重 0 的渠道永远选不中) - 改密成功后主动清会话回登录页(后端已递增 token_version,当前会话已作废)
This commit is contained in:
1 parent
e3ff0d3329
commit
4df2506a74
9 files changed
+83
-42
No files matched your search
+2
-12
@@ -4,18 +4,8 @@
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" href="/favicon.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<script>
|
||||
// 防止主题闪烁:应用前先按 localStorage/系统偏好设置 data-theme
|
||||
;(function () {
|
||||
try {
|
||||
var m = localStorage.getItem('ot_theme') || 'system'
|
||||
var dark = m === 'dark' || (m === 'system' && window.matchMedia('(prefers-color-scheme: dark)').matches)
|
||||
document.documentElement.setAttribute('data-theme', dark ? 'dark' : 'light')
|
||||
} catch (e) {
|
||||
document.documentElement.setAttribute('data-theme', 'dark')
|
||||
}
|
||||
})()
|
||||
</script>
|
||||
<!-- 防主题闪烁;外部文件是为了过 CSP script-src 'self' -->
|
||||
<script src="/theme-init.js"></script>
|
||||
<title>openteam · LLM API 中转站</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
Reference in new issue
Block a user