实现企微首次免密自动绑定(07-28-all-account-login-readiness)
这个提交包含在:
+19
-3
@@ -69,11 +69,27 @@ export function resolveWecomEntryStatus(config?: WecomEntryConfig | null) {
|
||||
}
|
||||
|
||||
export function resolveWecomLoginNotice(value: string | null): WecomNotice | null {
|
||||
if (value === "unbound") {
|
||||
if (value === "unbound" || value === "account_mapping_required") {
|
||||
return {
|
||||
tone: "warning",
|
||||
title: "当前企业微信账号尚未绑定",
|
||||
description: "请先用账号密码登录,再到个人设置完成绑定。",
|
||||
title: "企业微信账号映射尚未完成",
|
||||
description: "系统未能用企业微信 userid 或企业邮箱唯一匹配 OA 账户,请联系管理员核对通讯录同步。",
|
||||
};
|
||||
}
|
||||
|
||||
if (value === "account_mapping_conflict") {
|
||||
return {
|
||||
tone: "warning",
|
||||
title: "企业微信账号映射存在冲突",
|
||||
description: "userid 与 OA 账户映射不唯一,系统已停止自动绑定,请联系管理员核对。",
|
||||
};
|
||||
}
|
||||
|
||||
if (value === "account_mapping_inactive") {
|
||||
return {
|
||||
tone: "warning",
|
||||
title: "对应的 OA 账号不可用",
|
||||
description: "企微成员或匹配到的 OA 账户不是启用状态,请联系管理员处理。",
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ test("E2E 企微入口:普通浏览器下只提示企业微信工作台打开"
|
||||
await expect(page.getByTestId("wecom-entry-secondary")).toHaveCount(0);
|
||||
});
|
||||
|
||||
test("E2E 企微入口:企业微信场景优先显示企微 CTA,并展示未绑定提示", async ({ page }) => {
|
||||
test("E2E 企微入口:企业微信场景优先显示企微 CTA,并展示映射缺失提示", async ({ page }) => {
|
||||
await page.addInitScript(() => {
|
||||
Object.defineProperty(window.navigator, "userAgent", {
|
||||
configurable: true,
|
||||
@@ -80,9 +80,10 @@ test("E2E 企微入口:企业微信场景优先显示企微 CTA,并展示未
|
||||
});
|
||||
});
|
||||
|
||||
await page.goto("/login?redirect=%2Fportal&wecom=unbound");
|
||||
await page.goto("/login?redirect=%2Fportal&wecom=account_mapping_required");
|
||||
await expect(page.getByTestId("login-wecom-primary-panel")).toBeVisible();
|
||||
await expect(page.getByTestId("wecom-entry-primary")).toBeVisible();
|
||||
await expect(page.getByTestId("login-wecom-notice")).toContainText("当前企业微信账号尚未绑定");
|
||||
await expect(page.getByTestId("login-wecom-notice")).toContainText("企业微信账号映射尚未完成");
|
||||
await expect(page.getByTestId("login-wecom-notice")).not.toContainText("账号密码登录");
|
||||
await expect(page.getByTestId("login-password-secondary-panel")).toBeVisible();
|
||||
});
|
||||
|
||||
@@ -7,7 +7,7 @@ function envelope(data: unknown) {
|
||||
};
|
||||
}
|
||||
|
||||
test("E2E 企微首次绑定:未绑定回退到密码登录后可继续进入目标页", async ({ page }) => {
|
||||
test("E2E 企微首次登录:映射缺失时失败关闭且不要求用密码完成绑定", async ({ page }) => {
|
||||
await page.addInitScript(() => {
|
||||
Object.defineProperty(window.navigator, "userAgent", {
|
||||
configurable: true,
|
||||
@@ -177,13 +177,8 @@ test("E2E 企微首次绑定:未绑定回退到密码登录后可继续进入
|
||||
});
|
||||
});
|
||||
|
||||
await page.goto("/login?redirect=%2Fmobile&wecom=unbound");
|
||||
await expect(page.getByTestId("login-wecom-notice")).toContainText("当前企业微信账号尚未绑定");
|
||||
if (await page.getByTestId("login-identifier").count() === 0) {
|
||||
await page.getByRole("button", { name: "使用账号密码登录" }).click();
|
||||
}
|
||||
await page.getByTestId("login-identifier").fill("[email protected]");
|
||||
await page.getByTestId("login-password").fill("ResetA1abc123def456");
|
||||
await page.getByTestId("login-submit").click();
|
||||
await expect(page).toHaveURL(/\/mobile/);
|
||||
await page.goto("/login?redirect=%2Fmobile&wecom=account_mapping_required");
|
||||
await expect(page.getByTestId("login-wecom-notice")).toContainText("企业微信账号映射尚未完成");
|
||||
await expect(page.getByTestId("login-wecom-notice")).toContainText("请联系管理员核对通讯录同步");
|
||||
await expect(page.getByTestId("login-wecom-notice")).not.toContainText("先用账号密码登录");
|
||||
});
|
||||
|
||||
在新工单中引用
屏蔽一个用户