| | |
| | | |
| | | import { overridesPreferences, preferencesExtension } from './preferences'; |
| | | |
| | | declare const __APP_LOGO__: string; |
| | | declare const __APP_FAVICON__: string; |
| | | |
| | | /** |
| | | * 应用初始化完成之后再进行页面加载渲染 |
| | | */ |
| | |
| | | overrides: overridesPreferences, |
| | | }); |
| | | |
| | | // 通过环境变量强制覆盖公司 logo 和 favicon,绕过缓存 |
| | | const envLogo = import.meta.env.VITE_APP_LOGO; |
| | | const envFavicon = import.meta.env.VITE_APP_FAVICON; |
| | | if (envLogo) { |
| | | preferencesManager.updatePreferences({ logo: { source: envLogo } }); |
| | | // 强制覆盖公司 logo 和 favicon,绕过 localStorage 缓存 |
| | | if (__APP_LOGO__) { |
| | | preferencesManager.updatePreferences({ logo: { source: __APP_LOGO__ } }); |
| | | } |
| | | if (envFavicon) { |
| | | if (__APP_FAVICON__) { |
| | | const link = document.querySelector('link[rel="icon"]'); |
| | | if (link) { |
| | | link.setAttribute('href', envFavicon); |
| | | link.setAttribute('href', __APP_FAVICON__); |
| | | } |
| | | } |
| | | |