From 2b00fdc8d29a47b276c2b4619def9db3663ce2a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A9=AC=E7=99=BB=E5=B1=B1?= Date: Mon, 12 Jan 2026 16:56:43 +0800 Subject: [PATCH] docs: remove code comments about config.json --- tests/utils/config-helpers.test.ts | 16 ---------------- utils/config-helpers.ts | 5 ----- 2 files changed, 21 deletions(-) diff --git a/tests/utils/config-helpers.test.ts b/tests/utils/config-helpers.test.ts index d9c20a7..6fd9166 100644 --- a/tests/utils/config-helpers.test.ts +++ b/tests/utils/config-helpers.test.ts @@ -221,22 +221,6 @@ describe('config-helpers', () => { json: () => Promise.resolve(null), } as Response) }) - - it('应该正确调用 fetch 并设置超时', async () => { - vi.mocked(fetch).mockResolvedValueOnce({ - ok: true, - json: () => Promise.resolve({}), - } as Response) - - expect(fetch).toHaveBeenCalledWith( - 'https://localhost:3000/config.json', - expect.objectContaining({ - method: 'GET', - headers: { 'Content-Type': 'application/json' }, - signal: expect.any(AbortSignal), - }) - ) - }) }) describe('getConfig', () => { diff --git a/utils/config-helpers.ts b/utils/config-helpers.ts index 4f8b57e..76b36a7 100644 --- a/utils/config-helpers.ts +++ b/utils/config-helpers.ts @@ -283,11 +283,6 @@ const mergeServerConfig = (baseConfig: SiteConfig, serverConfig: ServerConfigRes /** * Configuration priority strategy: server > localStorage > browser > default * - * Attempts to retrieve configuration in the following priority order: - * 1. Server configuration (from current host's /config.json) - * 2. Configuration saved in localStorage - * 3. Current browser host configuration - * 4. Default configuration (localhost:9000) * * @returns Promise containing the final configuration retrieval result *