From 78e85c246f370596a21985a400406b07ea566893 Mon Sep 17 00:00:00 2001 From: Alex Cheung Date: Thu, 22 Aug 2024 12:33:58 +0800 Subject: [PATCH] update uat title color change --- src/components/AdminLogo/index.js | 5 ++++- src/components/SysSettingProvider.js | 2 ++ src/layout/MainLayout/Header/index.js | 13 +++++++------ src/pages/authentication/AuthWrapper.js | 10 ++++++++++ src/utils/HttpUtils.js | 2 +- src/utils/Utils.js | 6 ++++++ 6 files changed, 30 insertions(+), 8 deletions(-) diff --git a/src/components/AdminLogo/index.js b/src/components/AdminLogo/index.js index bcc0d89..8a75781 100644 --- a/src/components/AdminLogo/index.js +++ b/src/components/AdminLogo/index.js @@ -11,6 +11,9 @@ import Logo from './AdminLogo'; import config from 'config'; import { activeItem } from 'store/reducers/menu'; import { Stack } from '@mui/material'; +import { + checkSysEnv +} from "utils/Utils"; // ==============================|| MAIN LOGO ||============================== // @@ -28,7 +31,7 @@ const LogoSection = ({ sx, to }) => { > - PNSPS + PNSPS ); diff --git a/src/components/SysSettingProvider.js b/src/components/SysSettingProvider.js index 94ee8af..ac7dbbc 100644 --- a/src/components/SysSettingProvider.js +++ b/src/components/SysSettingProvider.js @@ -18,7 +18,9 @@ const SysSettingProvider = ({ children }) => { get({ url: GET_SYS_SETTING, onSuccess: (responseData) => { + // console.log(responseData) setSysSetting(responseData); + localStorage.setItem('sysEnv', responseData.sysEnv) } }); } diff --git a/src/layout/MainLayout/Header/index.js b/src/layout/MainLayout/Header/index.js index 4ccef9a..81ef09e 100644 --- a/src/layout/MainLayout/Header/index.js +++ b/src/layout/MainLayout/Header/index.js @@ -51,6 +51,7 @@ import { isPasswordExpiry, haveOrgPaymentRecord, isORGLoggedIn, + checkSysEnv // getUserId } from "utils/Utils"; import { handleLogoutFunction } from 'auth/index'; @@ -536,7 +537,7 @@ function Header(props) { */} - PNSPS + PNSPS
    @@ -555,7 +556,7 @@ function Header(props) { - PNSPS + PNSPS
      @@ -596,7 +597,7 @@ function Header(props) { - PNSPS + PNSPS RESTRICTED @@ -617,7 +618,7 @@ function Header(props) { {/*公共啟事提交*/} {/*及繳費系統*/} - + @@ -636,7 +637,7 @@ function Header(props) { - + @@ -735,7 +736,7 @@ function Header(props) { - + diff --git a/src/pages/authentication/AuthWrapper.js b/src/pages/authentication/AuthWrapper.js index 7a1e0af..95c1e37 100644 --- a/src/pages/authentication/AuthWrapper.js +++ b/src/pages/authentication/AuthWrapper.js @@ -22,6 +22,9 @@ const BackgroundHead = { height: '100%', backgroundSize:'cover' } +import { + checkSysEnv +} from "utils/Utils"; // ==============================|| AUTHENTICATION - WRAPPER ||============================== // @@ -54,6 +57,13 @@ const AuthWrapper = ({ children }) => ( + { + checkSysEnv()!=''? + + User Acceptance Test Environment + + :"" + } { }).then( (response) => { onResponse(response, onSuccess, onFail); } ).catch((error) => { - console.log(error); + // console.log(error); return handleError(error, onError); }); }; diff --git a/src/utils/Utils.js b/src/utils/Utils.js index 66211bc..795711f 100644 --- a/src/utils/Utils.js +++ b/src/utils/Utils.js @@ -99,6 +99,12 @@ export const haveOrgPaymentRecord = () =>{ if (localStorage.getItem('userData') != null){ return JSON.parse(localStorage.getItem('userData')).orgPaymentRecord } +} +export const checkSysEnv = () =>{ + if (localStorage.getItem('sysEnv') != null){ + console.log(localStorage.getItem('sysEnv')) + return localStorage.getItem('sysEnv') + } } /** ** This function is used for demo purpose route navigation