feat: 支持按品牌配置微信登录凭据
CI / Browser smoke (pull_request) Successful in 58s
CI / Static checks (pull_request) Successful in 1m32s
CI / API integration (pull_request) Successful in 1m27s
CI / Production build (pull_request) Successful in 2m7s

This commit is contained in:
que01 committed 2026-10-23 22:07:39 +08:00
1 parent e75c524343
commit d0a0eeea8c
23 files changed
+460 -62

No files matched your search

@@ -180,6 +180,8 @@ async function mockPublicationApi(page: Page, options: MockOptions = {}) {
appId: "wx0000000000000000",
apiBaseUrl: "https://wechat.app.que01.top/api",
hasStoredCredentials: false,
hasStoredAppSecret: false,
loginConfigured: false,
},
});
}
@@ -268,7 +270,7 @@ test("恢复历史版本会提交版本号并刷新发布记录", async ({ page
await expect(page.getByText("历史版本已重新发布")).toBeVisible();
});
test("小程序配置页回填服务端设置并仅提交新私钥", async ({ page }) => {
test("小程序配置页回填服务端设置并提交新的登录凭据与私钥", async ({ page }) => {
await page.setViewportSize({ width: 1440, height: 1000 });
const bodies: Record<string, unknown>[] = [];
await mockPublicationApi(page, {});
@@ -281,6 +283,8 @@ test("小程序配置页回填服务端设置并仅提交新私钥", async ({ pa
appId: body.appId,
apiBaseUrl: body.apiBaseUrl,
hasStoredCredentials: true,
hasStoredAppSecret: true,
loginConfigured: true,
},
});
}
@@ -292,10 +296,12 @@ test("小程序配置页回填服务端设置并仅提交新私钥", async ({ pa
await expect(page.getByLabel("微信 AppID")).toHaveValue("wx0000000000000000");
await expect(page.getByLabel("小程序请求地址")).toHaveValue("https://wechat.app.que01.top/api");
const appSecret = "0123456789abcdef0123456789abcdef";
await page.getByLabel("微信登录 AppSecret").fill(appSecret);
await page
.getByLabel("上传私钥")
.fill("-----BEGIN PRIVATE KEY-----\nKEY\n-----END PRIVATE KEY-----");
await page.getByRole("button", { name: "保存上传配置" }).click();
await page.getByRole("button", { name: "保存小程序配置" }).click();
await expect
.poll(() => bodies)
@@ -303,8 +309,9 @@ test("小程序配置页回填服务端设置并仅提交新私钥", async ({ pa
{
appId: "wx0000000000000000",
apiBaseUrl: "https://wechat.app.que01.top/api",
appSecret,
privateKey: "-----BEGIN PRIVATE KEY-----\nKEY\n-----END PRIVATE KEY-----",
},
]);
await expect(page.getByText("小程序上传配置已保存")).toBeVisible();
await expect(page.getByText("小程序配置已保存")).toBeVisible();
});