Download packages/effects/hooks/src/use-app-config.ts from binhugg3/admin: direct link, hf CLI and curl.
- Browser
- Download file 542 Bytes
-
https://huggingface.co/spaces/binhugg3/admin/resolve/main/packages/effects/hooks/src/use-app-config.ts
- Command line
-
hf download hf://spaces/binhugg3/admin/packages/effects/hooks/src/use-app-config.ts
-
curl -L -o use-app-config.ts https://huggingface.co/spaces/binhugg3/admin/resolve/main/packages/effects/hooks/src/use-app-config.ts
542 Bytes
| import type { | |
| ApplicationConfig, | |
| VbenAdminProAppConfigRaw, | |
| } from '@vben/types/global'; | |
| /** | |
| * 由 vite-inject-app-config 注入的全局配置 | |
| */ | |
| export function useAppConfig( | |
| env: Record<string, any>, | |
| isProduction: boolean, | |
| ): ApplicationConfig { | |
| // 生产环境下,直接使用 window._VBEN_ADMIN_PRO_APP_CONF_ 全局变量 | |
| const config = isProduction | |
| ? window._VBEN_ADMIN_PRO_APP_CONF_ | |
| : (env as VbenAdminProAppConfigRaw); | |
| const { VITE_GLOB_API_URL } = config; | |
| return { | |
| apiURL: VITE_GLOB_API_URL, | |
| }; | |
| } | |