@@ -4,45 +4,19 @@ import { Outlet } from 'umi';
44import { ConfigProvider , Spin } from 'antd' ;
55import { v4 as uuidv4 } from 'uuid' ;
66import { getAntdThemeConfig } from '@/theme' ;
7- import { IVersionResponse } from '@/typings' ;
87import miscService from '@/service/misc' ;
98import antdEnUS from 'antd/locale/en_US' ;
109import antdZhCN from 'antd/locale/zh_CN' ;
1110import { useTheme } from '@/hooks' ;
1211import { ThemeType , LangType , PrimaryColorType } from '@/constants/' ;
13- import styles from './index.less' ;
1412import { getLang , setLang } from '@/utils/localStorage' ;
1513import { clearOlderLocalStorage } from '@/utils' ;
1614import registerMessage from './init/registerMessage' ;
1715import registerNotification from './init/registerNotification' ;
1816import MyNotification from '@/components/MyNotification' ;
19- // import Iconfont from '@/components/Iconfont';
20- // import Setting from '@/blocks/Setting';
2117import indexedDB from '@/indexedDB' ;
2218import useCopyFocusData from '@/hooks/useFocusData' ;
23-
24- declare global {
25- interface Window {
26- _Lang : string ;
27- _APP_PORT : string ;
28- _BUILD_TIME : string ;
29- _BaseURL : string ;
30- _AppThemePack : { [ key in string ] : string } ;
31- _appGatewayParams : IVersionResponse ;
32- _notificationApi : any ;
33- _indexedDB : any ;
34- electronApi ?: {
35- startServerForSpawn : ( ) => void ;
36- quitApp : ( ) => void ;
37- setBaseURL : ( baseUrl : string ) => void ;
38- registerAppMenu : ( data : any ) => void ;
39- } ;
40- }
41- const __APP_VERSION__ : string ;
42- const __BUILD_TIME__ : string ;
43- const __ENV__ : string ;
44- const __APP_PORT__ : string ;
45- }
19+ import styles from './index.less' ;
4620
4721const initConfig = ( ) => {
4822 registerMessage ( ) ;
@@ -139,16 +113,7 @@ function AppContainer() {
139113 } ;
140114 }
141115
142- // 初始化语言
143- function initLang ( ) {
144- const lang = getLang ( ) ;
145- if ( ! lang ) {
146- setLang ( LangType . EN_US ) ;
147- document . documentElement . setAttribute ( 'lang' , LangType . EN_US ) ;
148- const date = new Date ( '2030-12-30 12:30:00' ) . toUTCString ( ) ;
149- document . cookie = `CHAT2DB.LOCALE=${ lang } ;Expires=${ date } ` ;
150- }
151- }
116+
152117
153118 useEffect ( ( ) => {
154119 detectionService ( ) ;
@@ -203,8 +168,7 @@ function AppContainer() {
203168 { startSchedule === 2 && < Outlet /> }
204169 </ div >
205170 ) }
206- { /* 全局的弹窗 */ }
207- < MyNotification />
171+
208172 </ div >
209173 ) ;
210174}
0 commit comments