|
|
@@ -3,7 +3,7 @@
|
|
|
import ReactGA from 'react-ga4';
|
|
|
|
|
|
// utils
|
|
|
-import {lazy, Suspense} from 'react';
|
|
|
+import {lazy, Suspense, useState} from 'react';
|
|
|
|
|
|
// styles
|
|
|
import ThemeStyles from '@styles/theme';
|
|
|
@@ -33,7 +33,7 @@ import useAuthRoute from '@hooks/useAuthRoute';
|
|
|
// utils
|
|
|
import {StyleSheetManager} from 'styled-components';
|
|
|
import {ThemeProvider as MuiThemeProvider, createTheme} from '@mui/material/styles';
|
|
|
-import {getUrlParam, localStorageGet, localStorageSet, preventDefault} from '@utils/helpers';
|
|
|
+import {getBrazilTimeStamp, getUrlParam, localStorageGet, localStorageSet, preventDefault} from '@utils/helpers';
|
|
|
import rtlPlugin from 'stylis-plugin-rtl';
|
|
|
import {CacheProvider} from '@emotion/react';
|
|
|
import createCache from '@emotion/cache';
|
|
|
@@ -78,6 +78,7 @@ import {ROUTE_PATH} from "@constants/routes";
|
|
|
import {onChangeUser, onChangeUserID} from "@features/actions/mainAction";
|
|
|
import {isInAppBrowser, isShowInstallBox, openUrlUseChrome} from "@utils/UAUtils";
|
|
|
import WInstallBox from "@widgets/WInstallBox";
|
|
|
+import WMaintainBox from "@widgets/WMaintainBox";
|
|
|
const objInfo={
|
|
|
gameID:0
|
|
|
}
|
|
|
@@ -105,6 +106,7 @@ const App = () => {
|
|
|
const openPay=useSelector(getOpenPay);
|
|
|
const guest=useSelector(getIsGuest);
|
|
|
const popBindPhone=useSelector(getPopBindPhone);
|
|
|
+ const [isMaintain, setIsMaintain] = useState(false);
|
|
|
const muiTheme = createTheme({
|
|
|
direction: direction,
|
|
|
});
|
|
|
@@ -206,6 +208,8 @@ const App = () => {
|
|
|
}
|
|
|
const appInitData=()=>{
|
|
|
// scroll to top on route change
|
|
|
+ //检查是否维护
|
|
|
+ if (checkMaintain())return;
|
|
|
checkInviteCode();
|
|
|
checkOpenInChrome();
|
|
|
loadFont();
|
|
|
@@ -276,6 +280,24 @@ const App = () => {
|
|
|
global.showBindPrompt();
|
|
|
global.ispopBindPhone=1;
|
|
|
}
|
|
|
+ //检查维护
|
|
|
+ const checkMaintain=()=>{
|
|
|
+ // let sdate=new Date(2024, 7, 27, 3, 0, 0);
|
|
|
+ // let edate=new Date(2024, 7, 27, 7, 0, 0);
|
|
|
+ // let stime=sdate.getTime();
|
|
|
+ // let etime=edate.getTime();
|
|
|
+ //巴西时间
|
|
|
+ let stime=getBrazilTimeStamp("2024-08-27 03:00:00");
|
|
|
+ // let stime=getBrazilTimeStamp("2024-08-26 16:34:00");
|
|
|
+ let etime=getBrazilTimeStamp("2024-08-27 07:00:00");
|
|
|
+ let now=Date.now();
|
|
|
+ let isopen=false;
|
|
|
+ if (now>=stime&&now<=etime){
|
|
|
+ isopen=true;
|
|
|
+ setIsMaintain(isopen);
|
|
|
+ }
|
|
|
+ return isopen;
|
|
|
+ }
|
|
|
//app Effect
|
|
|
//初始化
|
|
|
useEffect(() => {
|
|
|
@@ -316,6 +338,8 @@ const App = () => {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ //检查是否维护
|
|
|
+ checkMaintain();
|
|
|
},[preLocation])
|
|
|
//监听gameID
|
|
|
useEffect(()=>{
|
|
|
@@ -345,6 +369,9 @@ const App = () => {
|
|
|
//app Effect
|
|
|
|
|
|
const renderLayout=()=>{
|
|
|
+ if (isMaintain)return (
|
|
|
+ <WMaintainBox open={true}></WMaintainBox>
|
|
|
+ );
|
|
|
return (
|
|
|
<>
|
|
|
{
|
|
|
@@ -354,6 +381,8 @@ const App = () => {
|
|
|
)
|
|
|
}
|
|
|
const renderPreload=()=>{
|
|
|
+ //维护
|
|
|
+ if (isMaintain)return (<></>);
|
|
|
return (
|
|
|
<>
|
|
|
{
|