From 1a632f2cada9f0325e02057ff3d83fe0bc4f971d Mon Sep 17 00:00:00 2001 From: anna Date: Fri, 19 Jul 2024 11:31:14 +0800 Subject: [PATCH] add SYS.ui.manage.allowRegistration --- src/components/SysSettingProvider.js | 33 +++ src/index.js | 12 +- src/layout/MainLayout/Header/index.js | 47 ++-- .../AuthCallback/ResetPasswordSuccess.js | 34 +-- .../ForgotPassword/AuthCallback/index.js | 89 +------ .../AuthCallback/ResetPasswordSuccess.js | 40 +-- .../ForgotUsername/AuthCallback/index.js | 1 - .../authentication/auth-forms/AuthLogin.js | 17 -- .../auth-forms/AuthLoginCustom.js | 91 +++---- src/routes/LoginRoutes.js | 227 +++++++++--------- src/routes/index.js | 6 +- src/utils/ApiPathConst.js | 1 + 12 files changed, 253 insertions(+), 345 deletions(-) create mode 100644 src/components/SysSettingProvider.js diff --git a/src/components/SysSettingProvider.js b/src/components/SysSettingProvider.js new file mode 100644 index 0000000..94ee8af --- /dev/null +++ b/src/components/SysSettingProvider.js @@ -0,0 +1,33 @@ +import { useState, useEffect, createContext } from 'react'; +import { get } from "utils/HttpUtils" +import {GET_SYS_SETTING} from "utils/ApiPathConst" + + +const SysContext = createContext(); + +const SysSettingProvider = ({ children }) => { + + const [sysSetting, setSysSetting] = useState({}); + + useEffect(() => { + loadSysSetting(); + }, []); + + + const loadSysSetting = () => { + get({ + url: GET_SYS_SETTING, + onSuccess: (responseData) => { + setSysSetting(responseData); + } + }); + } + + return ( + + {children} + + ); +} + +export {SysContext, SysSettingProvider}; \ No newline at end of file diff --git a/src/index.js b/src/index.js index ee0bb28..abf9204 100644 --- a/src/index.js +++ b/src/index.js @@ -16,9 +16,10 @@ import 'assets/third-party/apex-chart.css'; import App from './App'; import { store } from 'store'; import reportWebVitals from './reportWebVitals'; -import {I18nProvider} from "components/I18nProvider"; -import {AutoLogoutProvider} from "components/AutoLogoutProvider"; -import {RefreshTokenProvider} from "components/RefreshTokenProvider"; +import { I18nProvider } from "components/I18nProvider"; +import { AutoLogoutProvider } from "components/AutoLogoutProvider"; +import { RefreshTokenProvider } from "components/RefreshTokenProvider"; +import { SysSettingProvider } from "components/SysSettingProvider"; // ==============================|| MAIN - REACT DOM RENDER ||============================== // @@ -26,18 +27,21 @@ const container = document.getElementById('root'); const root = createRoot(container); // createRoot(container!) if you use TypeScript //const NotAuthorized = lazy(() => import('../views/NotAuthorized')) //const Error = lazy(() => import('../views/Error')) + root.render( + - + + ); diff --git a/src/layout/MainLayout/Header/index.js b/src/layout/MainLayout/Header/index.js index 3bf4a5c..fc228ca 100644 --- a/src/layout/MainLayout/Header/index.js +++ b/src/layout/MainLayout/Header/index.js @@ -1,9 +1,10 @@ import PropTypes from 'prop-types'; import React -, { useState } +, { useState, useContext } from 'react'; import { useDispatch } from "react-redux"; import { useNavigate } from "react-router-dom"; +import { SysContext } from "components/SysSettingProvider" // material-ui // import { useTheme } from '@mui/material/styles'; @@ -68,6 +69,7 @@ const drawerWidth = 300; // ==============================|| MAIN LAYOUT - HEADER ||============================== // function Header(props) { + const { sysSetting } = useContext(SysContext); const { window } = props; const [mobileOpen, setMobileOpen] = useState(false); const dispatch = useDispatch() @@ -87,7 +89,7 @@ function Header(props) { const loginContent = ( isGLDLoggedIn() ?
- {isPasswordExpiry()? + {isPasswordExpiry() ?
  • @@ -99,7 +101,7 @@ function Header(props) {
  • :
    -
  • +
  • Dashboard @@ -148,7 +150,7 @@ function Header(props) { : <> } - + { isGranted("MAINTAIN_RECON") ? <> @@ -316,7 +318,7 @@ function Header(props) {
  • :
    - {isPasswordExpiry()? + {isPasswordExpiry() ?
  • @@ -345,7 +347,7 @@ function Header(props) {
  • {isCreditorLoggedIn() ? - haveOrgPaymentRecord()? + haveOrgPaymentRecord() ? <> @@ -366,21 +368,21 @@ function Header(props) {
  • - : + : - : - isORGLoggedIn()? - haveOrgPaymentRecord()? + : + isORGLoggedIn() ? + haveOrgPaymentRecord() ? - : + : - : + : @@ -497,7 +499,7 @@ function Header(props) { const logoutContent = (
    -
  • +
  • @@ -511,13 +513,18 @@ function Header(props) {
  • -
  • - - - - - -
  • + { + sysSetting?.allowRegistration ? +
  • + + + + + +
  • + : + <> + }
    ); diff --git a/src/pages/authentication/ForgotPassword/AuthCallback/ResetPasswordSuccess.js b/src/pages/authentication/ForgotPassword/AuthCallback/ResetPasswordSuccess.js index 2b81f48..502600f 100644 --- a/src/pages/authentication/ForgotPassword/AuthCallback/ResetPasswordSuccess.js +++ b/src/pages/authentication/ForgotPassword/AuthCallback/ResetPasswordSuccess.js @@ -1,48 +1,20 @@ -// import { useFormik } from 'formik'; -// import * as yup from 'yup'; + import * as React from "react"; -// import * as HttpUtils from "utils/HttpUtils"; -// import * as UrlUtils from "utils/ApiPathConst"; -// import { useNavigate } from "react-router-dom"; -// import { useDispatch } from "react-redux"; -// import { handleLogoutFunction, handleLogin} from 'auth/index'; -// import useJwt from "auth/jwt/useJwt"; import { Grid, Typography, Button, - // RadioGroup, - // Dialog, DialogTitle, DialogContent, DialogActions, Stack, - // InputLabel, - // OutlinedInput, - // FormHelperText, - // TextField, - // IconButton, InputAdornment, - // Box, - // FormControl } from '@mui/material'; import Loadable from 'components/Loadable'; const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/LoadingComponent'))); import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' -// import ForwardIcon from '@mui/icons-material/Forward'; import MainCard from 'components/MainCard'; -// import {PNSPS_LONG_BUTTON_THEME} from "themes/buttonConst"; -// import {ThemeProvider} from "@emotion/react"; -import {FormattedMessage, - // useIntl -} from "react-intl"; -// import { EyeInvisibleOutlined, EyeOutlined } from '@ant-design/icons'; -// import axios from 'axios'; -import { - // useParams, - Link -} from 'react-router-dom'; +import {FormattedMessage,} from "react-intl"; +import { Link } from 'react-router-dom'; import CheckCircleOutlineIcon from '@mui/icons-material/CheckCircleOutline'; -// import LocaleContext from "components/I18nProvider"; - // ==============================|| DASHBOARD - DEFAULT ||============================== // const ResetPasswordSuccess = () => { diff --git a/src/pages/authentication/ForgotPassword/AuthCallback/index.js b/src/pages/authentication/ForgotPassword/AuthCallback/index.js index 8d290cc..c04d2f1 100644 --- a/src/pages/authentication/ForgotPassword/AuthCallback/index.js +++ b/src/pages/authentication/ForgotPassword/AuthCallback/index.js @@ -6,7 +6,7 @@ import * as UrlUtils from "utils/ApiPathConst"; import { useNavigate } from "react-router-dom"; import { useDispatch } from "react-redux"; import { handleLogoutFunction, - // handleLogin + } from 'auth/index'; import useJwt from "auth/jwt/useJwt"; @@ -14,21 +14,17 @@ import { Grid, Typography, Button, - // RadioGroup, - // Dialog, DialogTitle, DialogContent, DialogActions, Stack, InputLabel, - // OutlinedInput, + FormHelperText, TextField, IconButton, InputAdornment, - // Box, - // FormControl + } from '@mui/material'; import Loadable from 'components/Loadable'; const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/LoadingComponent'))); import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' -// import ForwardIcon from '@mui/icons-material/Forward'; import MainCard from 'components/MainCard'; import {PNSPS_LONG_BUTTON_THEME} from "themes/buttonConst"; import {ThemeProvider} from "@emotion/react"; @@ -37,7 +33,7 @@ import { EyeInvisibleOutlined, EyeOutlined } from '@ant-design/icons'; import axios from 'axios'; import { useParams,Link } from 'react-router-dom'; import CancelOutlinedIcon from '@mui/icons-material/CancelOutlined'; -// import LocaleContext from "components/I18nProvider"; + // ==============================|| DASHBOARD - DEFAULT ||============================== // @@ -50,7 +46,7 @@ const Index = () => { const [verifyState, setVerifyState] = React.useState(null) const [enterUseEffect, setEnterUseEffect] = React.useState(false) const [username, setUsername] = React.useState("") - // const { setLocale } = React.useContext(LocaleContext); + const params = useParams() const intl = useIntl(); @@ -61,7 +57,6 @@ const Index = () => { }, []); React.useEffect(() => { - // console.log("if (enterUseEffect) handleVerify()"); if (enterUseEffect){ handleVerify() } @@ -161,14 +156,10 @@ const Index = () => { const formik = useFormik({ enableReinitialize: true, initialValues: { - // username: '', password: '', confirmPassword: '', - // emailVerifyHash: '', }, validationSchema: yup.object().shape({ - // emailVerifyHash: yup.string().required(intl.formatMessage({id: 'requireSecurityCode'})), - // username: yup.string().required(intl.formatMessage({id: 'requireUsername'})), password: yup.string().min(8, intl.formatMessage({id: 'atLeast8CharPassword'})) .required(intl.formatMessage({id: 'requirePassword'})) .matches(/^\S*$/, { message: (intl.formatMessage({id: 'noSpacePassword'}))}) @@ -204,18 +195,7 @@ const Index = () => {
    - {/* - - */} - {/* - 申請公共啟事 - */} + { - {/* - - - { - if (e.key === 'Enter') { - e.preventDefault(); - } - }, - }} - InputLabelProps={{ - shrink: true - }} - /> - - {formik.touched.emailVerifyHash && formik.errors.emailVerifyHash && ( - - {formik.errors.emailVerifyHash} - - )} - - */} + @@ -291,7 +238,7 @@ const Index = () => { name="username" label={intl.formatMessage({id: 'userLoginName'}) + ":"} placeholder={intl.formatMessage({id: 'userLoginName'})} - // defaultValue={username} + value={username} disabled={true} /> @@ -312,7 +259,7 @@ const Index = () => { name="password" label={intl.formatMessage({id: 'newPassword'}) + ":"} placeholder={intl.formatMessage({id: 'newPassword'})} - // defaultValue={formik.values.password.trim()} + value={formik.values.password.trim()} error={Boolean(formik.touched.password && formik.errors.password)} onBlur={formik.handleBlur} @@ -343,18 +290,7 @@ const Index = () => { }} /> - {/* - - - - - - - - - - - */} + {formik.touched.password && formik.errors.password && ( {formik.errors.password} @@ -369,14 +305,14 @@ const Index = () => { fullWidth onChange={(e) => { formik.handleChange(e); - // changePassword(e.target.value); + }} id="confirmPassword" type={showConfirmPassword ? 'text' : 'password'} name="confirmPassword" label={intl.formatMessage({id: 'confirmPassword'}) + ":"} placeholder={intl.formatMessage({id: 'confirmPassword'})} - // defaultValue={formik.values.confirmPassword.trim()} + value={formik.values.confirmPassword.trim()} error={Boolean(formik.touched.confirmPassword && formik.errors.confirmPassword)} onBlur={formik.handleBlur} @@ -432,7 +368,6 @@ const Index = () => { // ERROR page - {/* */} diff --git a/src/pages/authentication/ForgotUsername/AuthCallback/ResetPasswordSuccess.js b/src/pages/authentication/ForgotUsername/AuthCallback/ResetPasswordSuccess.js index 148d3bd..c786e24 100644 --- a/src/pages/authentication/ForgotUsername/AuthCallback/ResetPasswordSuccess.js +++ b/src/pages/authentication/ForgotUsername/AuthCallback/ResetPasswordSuccess.js @@ -1,70 +1,32 @@ -// import { useFormik } from 'formik'; -// import * as yup from 'yup'; import * as React from "react"; -// import * as HttpUtils from "utils/HttpUtils"; -// import * as UrlUtils from "utils/ApiPathConst"; -// import { useNavigate } from "react-router-dom"; -// import { useDispatch } from "react-redux"; -// import { handleLogoutFunction, handleLogin} from 'auth/index'; -// import useJwt from "auth/jwt/useJwt"; - import { Grid, Typography, Button, - // RadioGroup, - // Dialog, DialogTitle, DialogContent, DialogActions, Stack, - // InputLabel, - // OutlinedInput, - // FormHelperText, - // TextField, - // IconButton, InputAdornment, - // Box, - // FormControl } from '@mui/material'; import Loadable from 'components/Loadable'; const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/LoadingComponent'))); import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' -// import ForwardIcon from '@mui/icons-material/Forward'; import MainCard from 'components/MainCard'; -// import {PNSPS_LONG_BUTTON_THEME} from "themes/buttonConst"; -// import {ThemeProvider} from "@emotion/react"; import {FormattedMessage, - // useIntl } from "react-intl"; -// import { EyeInvisibleOutlined, EyeOutlined } from '@ant-design/icons'; -// import axios from 'axios'; import { - // useParams, Link } from 'react-router-dom'; import CheckCircleOutlineIcon from '@mui/icons-material/CheckCircleOutline'; -// import LocaleContext from "components/I18nProvider"; // ==============================|| DASHBOARD - DEFAULT ||============================== // const ResetPasswordSuccess = () => { - // const dispatch = useDispatch() - // const navigate = useNavigate() + const [isLoading, setLoding] = React.useState(true); - // const params = useParams() - // const intl = useIntl(); - React.useEffect(() => { - // console.log(params); setLoding(false) }, []); - // React.useEffect(() => { - // // console.log("if (enterUseEffect) handleVerify()"); - // if (enterUseEffect){ - // handleVerify() - // } - // }, [enterUseEffect]) - const BackgroundHead = { backgroundImage: `url(${titleBackgroundImg})`, width: 'auto', diff --git a/src/pages/authentication/ForgotUsername/AuthCallback/index.js b/src/pages/authentication/ForgotUsername/AuthCallback/index.js index 02bbcce..7aa9879 100644 --- a/src/pages/authentication/ForgotUsername/AuthCallback/index.js +++ b/src/pages/authentication/ForgotUsername/AuthCallback/index.js @@ -37,7 +37,6 @@ import { EyeInvisibleOutlined, EyeOutlined } from '@ant-design/icons'; import axios from 'axios'; import { useParams,Link } from 'react-router-dom'; import CancelOutlinedIcon from '@mui/icons-material/CancelOutlined'; -// import LocaleContext from "components/I18nProvider"; // ==============================|| DASHBOARD - DEFAULT ||============================== // diff --git a/src/pages/authentication/auth-forms/AuthLogin.js b/src/pages/authentication/auth-forms/AuthLogin.js index 3df24c7..9b48602 100644 --- a/src/pages/authentication/auth-forms/AuthLogin.js +++ b/src/pages/authentication/auth-forms/AuthLogin.js @@ -1,17 +1,12 @@ import React, { - // useContext, useEffect, useState} from 'react'; import {useNavigate} from 'react-router-dom'; // material-ui import { Button, - //Checkbox, - //Divider, - //FormControlLabel, FormHelperText, Grid, - //Link, IconButton, InputAdornment, InputLabel, @@ -25,9 +20,7 @@ import * as Yup from 'yup'; import { Formik } from 'formik'; // project import -//import FirebaseSocial from './FirebaseSocial'; import AnimateButton from 'components/@extended/AnimateButton'; -//import {AbilityContext} from "@src/utility/context/Can" import {apiPath} from "auth/utils"; import {POST_LOGIN} from "utils/ApiPathConst"; @@ -36,9 +29,7 @@ import { EyeOutlined, EyeInvisibleOutlined } from '@ant-design/icons'; import axios from "axios"; import {useDispatch} from "react-redux"; import {handleLogin} from "auth/index"; -// import { notifyActionSuccess } from 'utils/CommonFunction'; import {FormattedMessage} from "react-intl"; -// import LocaleContext from "../../../components/I18nProvider"; // ============================|| FIREBASE - LOGIN ||============================ // const AuthLogin = () => { @@ -224,14 +215,6 @@ const AuthLogin = () => { - {/**/} - {/* */} - {/* Login with*/} - {/* */} - {/**/} - {/**/} - {/* */} - {/**/} )} diff --git a/src/pages/authentication/auth-forms/AuthLoginCustom.js b/src/pages/authentication/auth-forms/AuthLoginCustom.js index 82e2acd..8de1605 100644 --- a/src/pages/authentication/auth-forms/AuthLoginCustom.js +++ b/src/pages/authentication/auth-forms/AuthLoginCustom.js @@ -2,7 +2,7 @@ import { useEffect, useState, lazy, - // useContext + useContext } from 'react'; import { Link as RouterLink } from 'react-router-dom'; import { useNavigate } from 'react-router-dom'; @@ -12,14 +12,10 @@ import { getBowserType, isAppBowser, iAmSmartCallbackPath } from 'auth/utils' import * as HttpUtils from "utils/HttpUtils"; import { I_AM_SMART_PATH } from "utils/ApiPathConst"; -//iAmSmartAppPath // material-ui import { Button, - //Checkbox, - //Divider, - //FormControlLabel, FormHelperText, Grid, Link, @@ -35,8 +31,6 @@ import { import * as yup from 'yup'; import { useFormik, FormikProvider } from 'formik'; -// project import -//import FirebaseSocial from './FirebaseSocial'; import AnimateButton from 'components/@extended/AnimateButton'; import Loadable from 'components/Loadable'; const PasswordAlertDialog = Loadable(lazy(() => import('./PasswordAlertDialog'))); @@ -49,9 +43,9 @@ import { handleLogin } from "auth/index"; import useJwt from "auth/jwt/useJwt"; import { handleLogoutFunction } from 'auth/index'; import { FormattedMessage, useIntl } from "react-intl"; +import { SysContext } from "components/SysSettingProvider" -import {IAmSmartButton} from "components/iAmSmartButton"; -// import LocaleContext from "components/I18nProvider"; +import { IAmSmartButton } from "components/iAmSmartButton"; const LoadingComponent = Loadable(lazy(() => import('pages/extra-pages/LoadingComponent'))); // ============================|| FIREBASE - LOGIN ||============================ // @@ -61,14 +55,13 @@ const AuthLoginCustom = () => { const navigate = useNavigate() const intl = useIntl(); const { locale } = intl; - // const { setLocaleFromLogin } = useContext(LocaleContext); + const { sysSetting } = useContext(SysContext); const [showPassword, setShowPassword] = useState(false); const handleClickShowPassword = () => { setShowPassword(!showPassword); }; - // let [posts, setPosts] = useState([]); const [isValid, setisValid] = useState(false); const [open, setOpen] = useState(false); const [isButtonDisabled, setIsButtonDisabled] = useState(true); @@ -149,7 +142,6 @@ const AuthLoginCustom = () => { submit: null }), validationSchema: yup.object().shape({ - // username: yup.string().min(6,'用戶名稱最少6位').required('請輸入用戶名稱'), username: yup.string().required(intl.formatMessage({ id: 'requireUsername' })), password: yup.string().min(8, intl.formatMessage({ id: 'atLeast8CharPassword' })).required(intl.formatMessage({ id: 'requirePassword' })) .matches(/^(?=.*[a-z])/, intl.formatMessage({ id: 'atLeastOneSmallLetter' })) @@ -208,7 +200,7 @@ const AuthLoginCustom = () => { const { handleSubmit } = useForm({}) - function getQRWithIAmSmart(){ + function getQRWithIAmSmart() { if (isAppBowser()) { openApp(); } else { @@ -231,10 +223,10 @@ const AuthLoginCustom = () => { + "&lang=" + (locale === 'en' ? "en-US" : locale === 'zh-HK' ? "zh-HK" : "zh-CN") //+"&state=" + "&brokerPage=false" - window.location = url; + window.location = url; } }); - + } const openApp = () => { @@ -269,7 +261,7 @@ const AuthLoginCustom = () => { + "&lang=" + (locale === 'en' ? "en-US" : locale === 'zh-HK' ? "zh-HK" : "zh-CN") //+"&state=" + "&brokerPage=false" - window.location = url; + window.location = url; } }); @@ -393,35 +385,44 @@ const AuthLoginCustom = () => { - - - - - - - - - - - - {intl.formatMessage({ id: 'learnMore' }) + " >"} - - - - - - - - - - - + { + sysSetting?.allowRegistration ? + <> + + + + + + + + + + + + {intl.formatMessage({ id: 'learnMore' }) + " >"} + + + + + + + + + + + + + : + <> + } + + diff --git a/src/routes/LoginRoutes.js b/src/routes/LoginRoutes.js index 965cac9..835823f 100644 --- a/src/routes/LoginRoutes.js +++ b/src/routes/LoginRoutes.js @@ -1,4 +1,5 @@ -import { lazy } from 'react'; +import { lazy, useContext } from 'react'; +import { SysContext } from "components/SysSettingProvider" // project import import Loadable from 'components/Loadable'; @@ -39,111 +40,121 @@ const Payment_FPS_CallBack = Loadable(lazy(() => import('pages/Payment/FPS/fpsca // ==============================|| AUTH ROUTING ||============================== // -const LoginRoutes = { - path: '/', - element: , - children: [ - { - path: 'login', - element: - }, - { - path: 'register', - element: - }, - { - path: 'registerFrom', - element: - }, - { - path: 'registerFromOrganization', - element: - }, - { - path: 'iAmSmartRegisterFrom', - element: - }, - { - path: 'error', - element: - }, - { - path: 'privacyPolicy', - element: - }, - { - path: 'aboutUs', - element: - }, - { - path: 'iamsmart/logincallback', - element: - }, - { - path: 'iamsmart/loginfallback', - element: - }, - { - path: 'iamsmart/notverify', - element: - }, - { - path: 'iamsmart/authcallback', - element: - }, - { - path: 'iamsmart/registrycallback', - element: - }, - { - path: 'iamsmart/loginFail', - element: - }, - { - path: 'verify/:verifyCode/:email', - element: - }, - { - path: 'testfps', - element: - }, - { - path: 'testfpscallback', - element: - }, - { - path: 'forgot/password', - element: - }, - { - path: 'forgot/password/sent', - element: - }, - { - path: 'forgot/password/verify/:verifyCode/:email', - element: - }, - { - path: 'forgot/password/success', - element: - }, - { - path: 'forgot/username', - element: - }, - { - path: 'forgot/username/sent', - element: - }, - { - path: 'forgot/username/verify/:verifyCode/:email', - element: - }, - { - path: 'forgot/username/success', - element: - }, - ] -}; +export default function LoginRoutes(){ + + const { sysSetting } = useContext(SysContext); + + return { + path: '/', + element: , + children: [ + { + path: 'login', + element: + }, + ... sysSetting?.allowRegistration ?[ + { + path: 'register', + element: + }, + { + path: 'registerFrom', + element: + }, + { + path: 'registerFromOrganization', + element: + }, + { + path: 'iAmSmartRegisterFrom', + element: + }, + { + path: 'iamsmart/registrycallback', + element: + }, + { + path: 'verify/:verifyCode/:email', + element: + }, + ]:[] + , + { + path: 'error', + element: + }, + { + path: 'privacyPolicy', + element: + }, + { + path: 'aboutUs', + element: + }, + { + path: 'iamsmart/logincallback', + element: + }, + { + path: 'iamsmart/loginfallback', + element: + }, + { + path: 'iamsmart/notverify', + element: + }, + { + path: 'iamsmart/authcallback', + element: + }, + { + path: 'iamsmart/loginFail', + element: + }, + { + path: 'testfps', + element: + }, + { + path: 'testfpscallback', + element: + }, + { + path: 'forgot/password', + element: + }, + { + path: 'forgot/password/sent', + element: + }, + { + path: 'forgot/password/verify/:verifyCode/:email', + element: + }, + { + path: 'forgot/password/success', + element: + }, + { + path: 'forgot/username', + element: + }, + { + path: 'forgot/username/sent', + element: + }, + { + path: 'forgot/username/verify/:verifyCode/:email', + element: + }, + { + path: 'forgot/username/success', + element: + }, + ] + }; +} + +// export default LoginRoutes; + -export default LoginRoutes; diff --git a/src/routes/index.js b/src/routes/index.js index 178822c..ea0c4e8 100644 --- a/src/routes/index.js +++ b/src/routes/index.js @@ -51,9 +51,9 @@ export default function ThemeRoutes() { path: '/dashboard', element: }, - isUserLoggedIn() && isINDLoggedIn() || isUserLoggedIn() && isORGLoggedIn() ? PublicUserRoutes : LoginRoutes, - isUserLoggedIn() && isGLDLoggedIn() ? SettingRoutes : LoginRoutes, - isUserLoggedIn() && isGLDLoggedIn() ? GLDUserRoutes : LoginRoutes, + isUserLoggedIn() && isINDLoggedIn() || isUserLoggedIn() && isORGLoggedIn() ? PublicUserRoutes : LoginRoutes(), + isUserLoggedIn() && isGLDLoggedIn() ? SettingRoutes : LoginRoutes(), + isUserLoggedIn() && isGLDLoggedIn() ? GLDUserRoutes : LoginRoutes(), !isUserLoggedIn() ? { path: '*', element: diff --git a/src/utils/ApiPathConst.js b/src/utils/ApiPathConst.js index 86f3487..57237cb 100644 --- a/src/utils/ApiPathConst.js +++ b/src/utils/ApiPathConst.js @@ -12,6 +12,7 @@ export const PRIVACY_POLICY_PATH = apiPath+'/privacyPolicy'; export const I_AM_SMART_PATH = apiPath+'/smart/call/iAmSmart'; export const I_AM_SMART_APP_PATH = apiPath+'/smart/call/app/iAmSmart'; +export const GET_SYS_SETTING = apiPath+'/sys'; //Group Config export const GET_GROUP_LIST_PATH = apiPath+'/group';