fix: 修复系统一致性与安全问题

This commit is contained in:
que01 committed 2026-10-14 17:36:46 +08:00
1 parent aaeec14733
commit f158f906d5
19 files changed
+194 -34

No files matched your search

+1 -1
View File
@@ -79,7 +79,7 @@ export interface BrandMethods {
getAdminMiniAppSettings(): Promise<MiniAppReleaseSettings>;
updateAdminMiniAppSettings(body: {
appId?: string;
artifactPath?: string;
apiBaseUrl?: string;
privateKey?: string;
}): Promise<MiniAppReleaseSettings>;
}
+1
View File
@@ -8,4 +8,5 @@ export interface PresignedUpload {
uploadUrl: string;
key: string;
publicUrl: string;
mode?: "local";
}
+26
View File
@@ -69,3 +69,29 @@ test("发布检查与发布操作使用当前品牌的管理接口", async () =>
},
]);
});
test("小程序上传配置会提交请求地址", async () => {
const calls: Array<{ url: string; method?: string; body?: string }> = [];
const client = new ApiClient({
baseUrl: "http://api.test",
token: "brand-token",
fetcher: async (url, init) => {
calls.push({ url, method: init?.method, body: init?.body });
return response({ appId: "wx123", apiBaseUrl: "https://wechat.example.com/api" });
},
});
await client.updateAdminMiniAppSettings({
appId: "wx123",
apiBaseUrl: "https://wechat.example.com/api",
});
assert.deepEqual(calls, [
{
url: "http://api.test/admin/miniapp-releases/settings",
method: "PATCH",
body: JSON.stringify({
appId: "wx123",
apiBaseUrl: "https://wechat.example.com/api",
}),
},
]);
});