()
| 41 | * 应用启动时调用一次(App.vue 或 main.ts)。 |
| 42 | */ |
| 43 | export async function initServices(): Promise<void> { |
| 44 | if (_initialized) return |
| 45 | |
| 46 | const platform = detectPlatform() |
| 47 | |
| 48 | switch (platform) { |
| 49 | case 'electron': |
| 50 | await initElectronAdapters() |
| 51 | break |
| 52 | case 'web-serve': |
| 53 | await initWebServeAdapters() |
| 54 | break |
| 55 | case 'web-browser': |
| 56 | await initWebBrowserAdapters() |
| 57 | break |
| 58 | } |
| 59 | |
| 60 | _initialized = true |
| 61 | } |
| 62 | |
| 63 | /** |
| 64 | * Electron adapters: Internal HTTP Server is a hard dependency. |
nothing calls this directly
no test coverage detected