feat: 新增3个思想实验室项目,完善私有剪贴板授权与上传功能,添加配套测试脚本

1. 新增怀旧弹珠台、人性与投资、穿越三体、四维空间四个思想实验室项目
2. 为私有剪贴板添加业务层授权校验,优化上传进度显示与鉴权失败处理
3. 新增多个调试与单元测试脚本,覆盖三体积分、弹珠台物理、集成测试等场景
4. 补全穿越三体项目的完整HTML页面资源
This commit is contained in:
yangxiangyuan
2026-08-07 17:49:24 +08:00
parent 0f8fe2c2e2
commit 4492b4106a
22 changed files with 6935 additions and 34 deletions
+11 -1
View File
@@ -2514,13 +2514,23 @@ const hasValidPrivateClipboardGuid = (req) => {
return incoming === value
} catch { return false }
}
const hasPrivateClipboardBusinessAuth = (req) => {
try {
const mod = require('./private_clipboard')
if (mod && typeof mod.hasBusinessAuth === 'function') return !!mod.hasBusinessAuth(req)
} catch {}
return false
}
const hasPrivateClipboardAuth = (req) => {
try {
const cfg = readPrivateClipboardAuthConfig()
if (cfg.enable_auth === false) return true
const cookies = parseCookie(req.headers.cookie || '')
const name = getPrivateClipboardCookieName()
return cookies[name] === '1'
if (cookies[name] === '1') return true
// Rule 12.10:第4层业务登录态(HMAC 签名校验通过)同样视为外层有效授权,
// 避免 gate cookie 过期后已登录用户“贴和传没有响应”
return hasPrivateClipboardBusinessAuth(req)
} catch { return false }
}
const isPrivateClipboardForceGuid = () => {