fix: 修复系统一致性与安全问题
This commit is contained in:
1 parent
aaeec14733
commit
f158f906d5
19 files changed
+194
-34
No files matched your search
@@ -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",
|
||||
}),
|
||||
},
|
||||
]);
|
||||
});
|
||||
Reference in new issue
Block a user