liu
3 天以前 ee7ac8df8bce38add1f75baf876b49de94b9e00a
src/main.ts
@@ -5,6 +5,13 @@
declare const __APP_LOGO__: string;
declare const __APP_FAVICON__: string;
declare const __APP_NAME__: string;
declare global {
  interface Window {
    __MOM_STARTUP__?: { finish: () => void; fail: (error: unknown) => void };
  }
}
/**
 * 应用初始化完成之后再进行页面加载渲染
@@ -27,6 +34,17 @@
  if (__APP_LOGO__) {
    preferencesManager.updatePreferences({ logo: { source: __APP_LOGO__ } });
  }
  // 强制覆盖公司名称,绕过 localStorage 缓存
  if (__APP_NAME__) {
    preferencesManager.updatePreferences({
      app: { name: __APP_NAME__ },
      copyright: { companyName: __APP_NAME__ },
    });
  }
  // 强制覆盖默认首页为"基础数据与一袋一码",绕过 localStorage 缓存
  preferencesManager.updatePreferences({
    app: { defaultHomePath: '/bagcode-home' },
  });
  if (__APP_FAVICON__) {
    const link = document.querySelector('link[rel="icon"]');
    if (link) {
@@ -41,6 +59,10 @@
  // 移除并销毁loading
  unmountGlobalLoading();
  window.__MOM_STARTUP__?.finish();
}
initApplication();
initApplication().catch((error: unknown) => {
  window.__MOM_STARTUP__?.fail(error);
  console.error('Application startup failed', error);
});