fix(island): 失焦收起加 500ms 宽限期 + 冒烟不再改写班级码(打包产物验证稳定)

- 灵动岛窗口 blur 处理增加 BLUR_GRACE_MS = 500:激活后 500ms 内的失焦一律忽略。
  实机/打包产物上偶发"刚展开就被系统换前台造成的 blur 立刻收起",
  表现为"下课后自动弹出通知详情"变成 pill(截图比例也随之异常);
  宽限期后该用例稳定,且"点击屏幕任意位置收起"用例(展开后等 700ms 再触发 blur)仍正常。
- 桌面冒烟准备班级账号时**永不修改班级码**(只按需重置密码):
  班级码是给学生用的凭据,不应被测试工具改写;实测产物验证不再依赖固定班级码。

验证: verify:desktop 53/53(首轮)与 47/47(二次启动)全绿
This commit is contained in:
LoveChengke committed 2026-09-12 17:48:32 +08:00
1 parent a5c717e33e
commit 93447922dc
2 files changed
+26 -13

No files matched your search

+10 -10
View File
@@ -83,17 +83,17 @@ async function provisionClassAccount() {
const target = classes[0];
if (!target) return null;
const code = target.code || `SMOKE${Math.floor(Math.random() * 9000 + 1000)}`;
// 冒烟**永不修改班级码**(班级码是给学生用的,不应被测试工具改写):
// 只有"现有班级码 + 目标密码登录失败"时才重置密码,班级码原样保留。
const code = target.code;
if (!code) return null;
// 若现有班级码 + 目标密码已经能登录,就直接复用,避免每次冒烟都改密码
if (target.code) {
const probe = await fetch(`${base}/auth/class-login`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ code: target.code, password }),
});
if (probe.ok) return { code: target.code, password, className: target.name };
}
const probe = await fetch(`${base}/auth/class-login`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ code, password }),
});
if (probe.ok) return { code, password, className: target.name };
const patchResponse = await fetch(`${base}/classes/${target.id}/class-account`, {
method: 'PATCH',