@@ -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 ( | |||||
<SysContext.Provider value={{ sysSetting, setSysSetting }} > | |||||
{children} | |||||
</SysContext.Provider> | |||||
); | |||||
} | |||||
export {SysContext, SysSettingProvider}; |
@@ -16,9 +16,10 @@ import 'assets/third-party/apex-chart.css'; | |||||
import App from './App'; | import App from './App'; | ||||
import { store } from 'store'; | import { store } from 'store'; | ||||
import reportWebVitals from './reportWebVitals'; | 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 ||============================== // | // ==============================|| MAIN - REACT DOM RENDER ||============================== // | ||||
@@ -26,18 +27,21 @@ const container = document.getElementById('root'); | |||||
const root = createRoot(container); // createRoot(container!) if you use TypeScript | const root = createRoot(container); // createRoot(container!) if you use TypeScript | ||||
//const NotAuthorized = lazy(() => import('../views/NotAuthorized')) | //const NotAuthorized = lazy(() => import('../views/NotAuthorized')) | ||||
//const Error = lazy(() => import('../views/Error')) | //const Error = lazy(() => import('../views/Error')) | ||||
root.render( | root.render( | ||||
<StrictMode> | <StrictMode> | ||||
<ReduxProvider store={store}> | <ReduxProvider store={store}> | ||||
<SysSettingProvider> | |||||
<I18nProvider> | <I18nProvider> | ||||
<BrowserRouter basename="/"> | <BrowserRouter basename="/"> | ||||
<RefreshTokenProvider> | <RefreshTokenProvider> | ||||
<AutoLogoutProvider> | <AutoLogoutProvider> | ||||
<App /> | |||||
<App /> | |||||
</AutoLogoutProvider> | </AutoLogoutProvider> | ||||
</RefreshTokenProvider> | </RefreshTokenProvider> | ||||
</BrowserRouter> | </BrowserRouter> | ||||
</I18nProvider> | </I18nProvider> | ||||
</SysSettingProvider> | |||||
</ReduxProvider> | </ReduxProvider> | ||||
</StrictMode> | </StrictMode> | ||||
); | ); | ||||
@@ -1,9 +1,10 @@ | |||||
import PropTypes from 'prop-types'; | import PropTypes from 'prop-types'; | ||||
import React | import React | ||||
, { useState } | |||||
, { useState, useContext } | |||||
from 'react'; | from 'react'; | ||||
import { useDispatch } from "react-redux"; | import { useDispatch } from "react-redux"; | ||||
import { useNavigate } from "react-router-dom"; | import { useNavigate } from "react-router-dom"; | ||||
import { SysContext } from "components/SysSettingProvider" | |||||
// material-ui | // material-ui | ||||
// import { useTheme } from '@mui/material/styles'; | // import { useTheme } from '@mui/material/styles'; | ||||
@@ -68,6 +69,7 @@ const drawerWidth = 300; | |||||
// ==============================|| MAIN LAYOUT - HEADER ||============================== // | // ==============================|| MAIN LAYOUT - HEADER ||============================== // | ||||
function Header(props) { | function Header(props) { | ||||
const { sysSetting } = useContext(SysContext); | |||||
const { window } = props; | const { window } = props; | ||||
const [mobileOpen, setMobileOpen] = useState(false); | const [mobileOpen, setMobileOpen] = useState(false); | ||||
const dispatch = useDispatch() | const dispatch = useDispatch() | ||||
@@ -87,7 +89,7 @@ function Header(props) { | |||||
const loginContent = ( | const loginContent = ( | ||||
isGLDLoggedIn() ? | isGLDLoggedIn() ? | ||||
<div id="adminContent"> | <div id="adminContent"> | ||||
{isPasswordExpiry()? | |||||
{isPasswordExpiry() ? | |||||
<div id="passwordExpiryedContent"> | <div id="passwordExpiryedContent"> | ||||
<li> | <li> | ||||
<Link className="manageUser" to={'/user/changePassword'}> | <Link className="manageUser" to={'/user/changePassword'}> | ||||
@@ -99,7 +101,7 @@ function Header(props) { | |||||
</div> | </div> | ||||
: | : | ||||
<div id="adminContentList"> | <div id="adminContentList"> | ||||
<li> | |||||
<li> | |||||
<Link className="dashboard" to='/dashboard'> | <Link className="dashboard" to='/dashboard'> | ||||
<Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }} > | <Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }} > | ||||
Dashboard | Dashboard | ||||
@@ -148,7 +150,7 @@ function Header(props) { | |||||
: | : | ||||
<></> | <></> | ||||
} | } | ||||
{ | { | ||||
isGranted("MAINTAIN_RECON") ? | isGranted("MAINTAIN_RECON") ? | ||||
<> | <> | ||||
@@ -316,7 +318,7 @@ function Header(props) { | |||||
</div> | </div> | ||||
: | : | ||||
<div id="individualUserContent"> | <div id="individualUserContent"> | ||||
{isPasswordExpiry()? | |||||
{isPasswordExpiry() ? | |||||
<div id="passwordExpiryedContent"> | <div id="passwordExpiryedContent"> | ||||
<li> | <li> | ||||
<Link className="manageUser" to={'/user/changePassword'}> | <Link className="manageUser" to={'/user/changePassword'}> | ||||
@@ -345,7 +347,7 @@ function Header(props) { | |||||
</li> | </li> | ||||
<li> | <li> | ||||
{isCreditorLoggedIn() ? | {isCreditorLoggedIn() ? | ||||
haveOrgPaymentRecord()? | |||||
haveOrgPaymentRecord() ? | |||||
<> | <> | ||||
<Link className="paymentRecord"> | <Link className="paymentRecord"> | ||||
<Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}> | <Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}> | ||||
@@ -366,21 +368,21 @@ function Header(props) { | |||||
</li> | </li> | ||||
</ul> | </ul> | ||||
</> | </> | ||||
: | |||||
: | |||||
<Link className="manageOrgUser" to='/paymentPage/demandNote'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}> | <Link className="manageOrgUser" to='/paymentPage/demandNote'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}> | ||||
<FormattedMessage id="paymentInfoRecord" /> | <FormattedMessage id="paymentInfoRecord" /> | ||||
</Typography></Link> | </Typography></Link> | ||||
: | |||||
isORGLoggedIn()? | |||||
haveOrgPaymentRecord()? | |||||
: | |||||
isORGLoggedIn() ? | |||||
haveOrgPaymentRecord() ? | |||||
<Link className="manageOrgUser" to='/paymentPage/search'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}> | <Link className="manageOrgUser" to='/paymentPage/search'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}> | ||||
<FormattedMessage id="onlinePaymentHistory" /> | <FormattedMessage id="onlinePaymentHistory" /> | ||||
</Typography></Link> | </Typography></Link> | ||||
: | |||||
: | |||||
<Link className="manageOrgUser" to='/paymentPage/demandNote'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}> | <Link className="manageOrgUser" to='/paymentPage/demandNote'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}> | ||||
<FormattedMessage id="paymentInfoRecord" /> | <FormattedMessage id="paymentInfoRecord" /> | ||||
</Typography></Link> | </Typography></Link> | ||||
: | |||||
: | |||||
<Link className="manageOrgUser" to='/paymentPage/search'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}> | <Link className="manageOrgUser" to='/paymentPage/search'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}> | ||||
<FormattedMessage id="onlinePaymentHistory" /> | <FormattedMessage id="onlinePaymentHistory" /> | ||||
</Typography></Link> | </Typography></Link> | ||||
@@ -497,7 +499,7 @@ function Header(props) { | |||||
const logoutContent = ( | const logoutContent = ( | ||||
<div> | <div> | ||||
<li> | |||||
<li> | |||||
<Link className="login" to={'/aboutUs'}> | <Link className="login" to={'/aboutUs'}> | ||||
<Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2 }}> | <Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2 }}> | ||||
<FormattedMessage id="aboutUs" /> | <FormattedMessage id="aboutUs" /> | ||||
@@ -511,13 +513,18 @@ function Header(props) { | |||||
</Typography> | </Typography> | ||||
</Link> | </Link> | ||||
</li> | </li> | ||||
<li> | |||||
<Link className="register" to='/register'> | |||||
<Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2 }}> | |||||
<FormattedMessage id="register" /> | |||||
</Typography> | |||||
</Link> | |||||
</li> | |||||
{ | |||||
sysSetting?.allowRegistration ? | |||||
<li> | |||||
<Link className="register" to='/register'> | |||||
<Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2 }}> | |||||
<FormattedMessage id="register" /> | |||||
</Typography> | |||||
</Link> | |||||
</li> | |||||
: | |||||
<></> | |||||
} | |||||
</div> | </div> | ||||
); | ); | ||||
@@ -1,48 +1,20 @@ | |||||
// import { useFormik } from 'formik'; | |||||
// import * as yup from 'yup'; | |||||
import * as React from "react"; | 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 { | import { | ||||
Grid, | Grid, | ||||
Typography, | Typography, | ||||
Button, | Button, | ||||
// RadioGroup, | |||||
// Dialog, DialogTitle, DialogContent, DialogActions, | |||||
Stack, | Stack, | ||||
// InputLabel, | |||||
// OutlinedInput, | |||||
// FormHelperText, | |||||
// TextField, | |||||
// IconButton, InputAdornment, | |||||
// Box, | |||||
// FormControl | |||||
} from '@mui/material'; | } from '@mui/material'; | ||||
import Loadable from 'components/Loadable'; | import Loadable from 'components/Loadable'; | ||||
const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/LoadingComponent'))); | const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/LoadingComponent'))); | ||||
import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' | import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' | ||||
// import ForwardIcon from '@mui/icons-material/Forward'; | |||||
import MainCard from 'components/MainCard'; | 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 CheckCircleOutlineIcon from '@mui/icons-material/CheckCircleOutline'; | ||||
// import LocaleContext from "components/I18nProvider"; | |||||
// ==============================|| DASHBOARD - DEFAULT ||============================== // | // ==============================|| DASHBOARD - DEFAULT ||============================== // | ||||
const ResetPasswordSuccess = () => { | const ResetPasswordSuccess = () => { | ||||
@@ -6,7 +6,7 @@ import * as UrlUtils from "utils/ApiPathConst"; | |||||
import { useNavigate } from "react-router-dom"; | import { useNavigate } from "react-router-dom"; | ||||
import { useDispatch } from "react-redux"; | import { useDispatch } from "react-redux"; | ||||
import { handleLogoutFunction, | import { handleLogoutFunction, | ||||
// handleLogin | |||||
} from 'auth/index'; | } from 'auth/index'; | ||||
import useJwt from "auth/jwt/useJwt"; | import useJwt from "auth/jwt/useJwt"; | ||||
@@ -14,21 +14,17 @@ import { | |||||
Grid, | Grid, | ||||
Typography, | Typography, | ||||
Button, | Button, | ||||
// RadioGroup, | |||||
// Dialog, DialogTitle, DialogContent, DialogActions, | |||||
Stack, | Stack, | ||||
InputLabel, | InputLabel, | ||||
// OutlinedInput, | |||||
FormHelperText, | FormHelperText, | ||||
TextField, | TextField, | ||||
IconButton, InputAdornment, | IconButton, InputAdornment, | ||||
// Box, | |||||
// FormControl | |||||
} from '@mui/material'; | } from '@mui/material'; | ||||
import Loadable from 'components/Loadable'; | import Loadable from 'components/Loadable'; | ||||
const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/LoadingComponent'))); | const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/LoadingComponent'))); | ||||
import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' | import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' | ||||
// import ForwardIcon from '@mui/icons-material/Forward'; | |||||
import MainCard from 'components/MainCard'; | import MainCard from 'components/MainCard'; | ||||
import {PNSPS_LONG_BUTTON_THEME} from "themes/buttonConst"; | import {PNSPS_LONG_BUTTON_THEME} from "themes/buttonConst"; | ||||
import {ThemeProvider} from "@emotion/react"; | import {ThemeProvider} from "@emotion/react"; | ||||
@@ -37,7 +33,7 @@ import { EyeInvisibleOutlined, EyeOutlined } from '@ant-design/icons'; | |||||
import axios from 'axios'; | import axios from 'axios'; | ||||
import { useParams,Link } from 'react-router-dom'; | import { useParams,Link } from 'react-router-dom'; | ||||
import CancelOutlinedIcon from '@mui/icons-material/CancelOutlined'; | import CancelOutlinedIcon from '@mui/icons-material/CancelOutlined'; | ||||
// import LocaleContext from "components/I18nProvider"; | |||||
// ==============================|| DASHBOARD - DEFAULT ||============================== // | // ==============================|| DASHBOARD - DEFAULT ||============================== // | ||||
@@ -50,7 +46,7 @@ const Index = () => { | |||||
const [verifyState, setVerifyState] = React.useState(null) | const [verifyState, setVerifyState] = React.useState(null) | ||||
const [enterUseEffect, setEnterUseEffect] = React.useState(false) | const [enterUseEffect, setEnterUseEffect] = React.useState(false) | ||||
const [username, setUsername] = React.useState("") | const [username, setUsername] = React.useState("") | ||||
// const { setLocale } = React.useContext(LocaleContext); | |||||
const params = useParams() | const params = useParams() | ||||
const intl = useIntl(); | const intl = useIntl(); | ||||
@@ -61,7 +57,6 @@ const Index = () => { | |||||
}, []); | }, []); | ||||
React.useEffect(() => { | React.useEffect(() => { | ||||
// console.log("if (enterUseEffect) handleVerify()"); | |||||
if (enterUseEffect){ | if (enterUseEffect){ | ||||
handleVerify() | handleVerify() | ||||
} | } | ||||
@@ -161,14 +156,10 @@ const Index = () => { | |||||
const formik = useFormik({ | const formik = useFormik({ | ||||
enableReinitialize: true, | enableReinitialize: true, | ||||
initialValues: { | initialValues: { | ||||
// username: '', | |||||
password: '', | password: '', | ||||
confirmPassword: '', | confirmPassword: '', | ||||
// emailVerifyHash: '', | |||||
}, | }, | ||||
validationSchema: yup.object().shape({ | 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'})) | password: yup.string().min(8, intl.formatMessage({id: 'atLeast8CharPassword'})) | ||||
.required(intl.formatMessage({id: 'requirePassword'})) | .required(intl.formatMessage({id: 'requirePassword'})) | ||||
.matches(/^\S*$/, { message: (intl.formatMessage({id: 'noSpacePassword'}))}) | .matches(/^\S*$/, { message: (intl.formatMessage({id: 'noSpacePassword'}))}) | ||||
@@ -204,18 +195,7 @@ const Index = () => { | |||||
</Stack> | </Stack> | ||||
</div> | </div> | ||||
</Grid> | </Grid> | ||||
{/* <Grid item xs={12} width={{xs:"90%", sm:"90%", md:"60%", lg:"60%"}}> | |||||
<Button | |||||
aria-label={intl.formatMessage({id: 'back'})} | |||||
title={intl.formatMessage({id: 'back'})} | |||||
sx={{ ml: 0, mt: 2.5 }} style={{ border: '2px solid' }} variant="outlined" onClick={() => { navigate(-1) }} | |||||
> | |||||
<ForwardIcon style={{ height: 30, width: 50, transform: "rotate(180deg)" }} /> | |||||
</Button> | |||||
</Grid> */} | |||||
{/* <Grid item xs={12}> | |||||
<Typography variant="pnspsFormParagraphBold">申請公共啟事</Typography> | |||||
</Grid> */} | |||||
<Grid item xs={12} md={12} width={{ sx:"90%", sm:"90%",md: "60%", xs: "90%" }}> | <Grid item xs={12} md={12} width={{ sx:"90%", sm:"90%",md: "60%", xs: "90%" }}> | ||||
<MainCard | <MainCard | ||||
sx={{ | sx={{ | ||||
@@ -248,40 +228,7 @@ const Index = () => { | |||||
</InputLabel> | </InputLabel> | ||||
</Grid> | </Grid> | ||||
</Grid> | </Grid> | ||||
{/* <Grid item xs={12} md={12} lg={12} width={{xs:"70%", sm:"60%",md:"50%", lg:"50%"}}> | |||||
<Grid container direction="row" justifyContent="flex-start"> | |||||
<Grid item xs={12} md={12} lg={12}> | |||||
<TextField | |||||
fullWidth | |||||
onChange={formik.handleChange} | |||||
id="emailVerifyHash" | |||||
name="emailVerifyHash" | |||||
label={intl.formatMessage({id: 'securityCode'}) + ":"} | |||||
placeholder={intl.formatMessage({id: 'securityCode'})} | |||||
defaultValue={formik.values.emailVerifyHash} | |||||
value={formik.values.emailVerifyHash} | |||||
error={Boolean(formik.touched.emailVerifyHash && formik.errors.emailVerifyHash)} | |||||
onBlur={formik.handleBlur} | |||||
inputProps={{ | |||||
maxLength: 50, | |||||
onKeyDown: (e) => { | |||||
if (e.key === 'Enter') { | |||||
e.preventDefault(); | |||||
} | |||||
}, | |||||
}} | |||||
InputLabelProps={{ | |||||
shrink: true | |||||
}} | |||||
/> | |||||
</Grid> | |||||
{formik.touched.emailVerifyHash && formik.errors.emailVerifyHash && ( | |||||
<FormHelperText error id="standard-weight-helper-text-username-login"> | |||||
{formik.errors.emailVerifyHash} | |||||
</FormHelperText> | |||||
)} | |||||
</Grid> | |||||
</Grid> */} | |||||
<Grid item xs={12} md={12} lg={12} width={{xs:"70%", sm:"60%",md:"50%", lg:"50%"}}> | <Grid item xs={12} md={12} lg={12} width={{xs:"70%", sm:"60%",md:"50%", lg:"50%"}}> | ||||
<Grid container direction="row" justifyContent="flex-start"> | <Grid container direction="row" justifyContent="flex-start"> | ||||
<Grid item xs={12} md={12} lg={12}> | <Grid item xs={12} md={12} lg={12}> | ||||
@@ -291,7 +238,7 @@ const Index = () => { | |||||
name="username" | name="username" | ||||
label={intl.formatMessage({id: 'userLoginName'}) + ":"} | label={intl.formatMessage({id: 'userLoginName'}) + ":"} | ||||
placeholder={intl.formatMessage({id: 'userLoginName'})} | placeholder={intl.formatMessage({id: 'userLoginName'})} | ||||
// defaultValue={username} | |||||
value={username} | value={username} | ||||
disabled={true} /> | disabled={true} /> | ||||
</Grid> | </Grid> | ||||
@@ -312,7 +259,7 @@ const Index = () => { | |||||
name="password" | name="password" | ||||
label={intl.formatMessage({id: 'newPassword'}) + ":"} | label={intl.formatMessage({id: 'newPassword'}) + ":"} | ||||
placeholder={intl.formatMessage({id: 'newPassword'})} | placeholder={intl.formatMessage({id: 'newPassword'})} | ||||
// defaultValue={formik.values.password.trim()} | |||||
value={formik.values.password.trim()} | value={formik.values.password.trim()} | ||||
error={Boolean(formik.touched.password && formik.errors.password)} | error={Boolean(formik.touched.password && formik.errors.password)} | ||||
onBlur={formik.handleBlur} | onBlur={formik.handleBlur} | ||||
@@ -343,18 +290,7 @@ const Index = () => { | |||||
}} | }} | ||||
/> | /> | ||||
</Grid> | </Grid> | ||||
{/* <FormControl fullWidth sx={{ mt: 2 }}> | |||||
<Grid container spacing={2} alignItems="center"> | |||||
<Grid item> | |||||
<Box sx={{ bgcolor: level?.color, width: 85, height: 8, borderRadius: '7px' }} /> | |||||
</Grid> | |||||
<Grid item> | |||||
<Typography variant="subtitle1"> | |||||
<FormattedMessage id={level ? level?.label : "pwWeak" }/> | |||||
</Typography> | |||||
</Grid> | |||||
</Grid> | |||||
</FormControl> */} | |||||
{formik.touched.password && formik.errors.password && ( | {formik.touched.password && formik.errors.password && ( | ||||
<FormHelperText error id="helper-text-password-signup"> | <FormHelperText error id="helper-text-password-signup"> | ||||
{formik.errors.password} | {formik.errors.password} | ||||
@@ -369,14 +305,14 @@ const Index = () => { | |||||
fullWidth | fullWidth | ||||
onChange={(e) => { | onChange={(e) => { | ||||
formik.handleChange(e); | formik.handleChange(e); | ||||
// changePassword(e.target.value); | |||||
}} | }} | ||||
id="confirmPassword" | id="confirmPassword" | ||||
type={showConfirmPassword ? 'text' : 'password'} | type={showConfirmPassword ? 'text' : 'password'} | ||||
name="confirmPassword" | name="confirmPassword" | ||||
label={intl.formatMessage({id: 'confirmPassword'}) + ":"} | label={intl.formatMessage({id: 'confirmPassword'}) + ":"} | ||||
placeholder={intl.formatMessage({id: 'confirmPassword'})} | placeholder={intl.formatMessage({id: 'confirmPassword'})} | ||||
// defaultValue={formik.values.confirmPassword.trim()} | |||||
value={formik.values.confirmPassword.trim()} | value={formik.values.confirmPassword.trim()} | ||||
error={Boolean(formik.touched.confirmPassword && formik.errors.confirmPassword)} | error={Boolean(formik.touched.confirmPassword && formik.errors.confirmPassword)} | ||||
onBlur={formik.handleBlur} | onBlur={formik.handleBlur} | ||||
@@ -432,7 +368,6 @@ const Index = () => { | |||||
// ERROR page | // ERROR page | ||||
<Grid container spacing={4} sx={{ minHeight: {xs:"80vh", sm:"70vh", md: "70vh", lg:"70vh", xl:"50vh"} }} direction="column" justifyContent="flex-start" alignItems="center"> | <Grid container spacing={4} sx={{ minHeight: {xs:"80vh", sm:"70vh", md: "70vh", lg:"70vh", xl:"50vh"} }} direction="column" justifyContent="flex-start" alignItems="center"> | ||||
<Grid item xs={12} md={12} lg={12} sx={{ mb: 1, mt:5,}}> | <Grid item xs={12} md={12} lg={12} sx={{ mb: 1, mt:5,}}> | ||||
{/* <Button disabled={true} hidden={true} variant="contained" type="submit" sx={{ fontSize: 12,height:'25px'}}>Submit</Button> */} | |||||
<CancelOutlinedIcon color="error" sx={{ width: "200px", height: "200px" }} /> | <CancelOutlinedIcon color="error" sx={{ width: "200px", height: "200px" }} /> | ||||
</Grid> | </Grid> | ||||
<Grid item xs={12} md={12} lg={12} sx={{ mb: 1, mt:5,}}> | <Grid item xs={12} md={12} lg={12} sx={{ mb: 1, mt:5,}}> | ||||
@@ -1,70 +1,32 @@ | |||||
// import { useFormik } from 'formik'; | |||||
// import * as yup from 'yup'; | |||||
import * as React from "react"; | 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 { | import { | ||||
Grid, | Grid, | ||||
Typography, | Typography, | ||||
Button, | Button, | ||||
// RadioGroup, | |||||
// Dialog, DialogTitle, DialogContent, DialogActions, | |||||
Stack, | Stack, | ||||
// InputLabel, | |||||
// OutlinedInput, | |||||
// FormHelperText, | |||||
// TextField, | |||||
// IconButton, InputAdornment, | |||||
// Box, | |||||
// FormControl | |||||
} from '@mui/material'; | } from '@mui/material'; | ||||
import Loadable from 'components/Loadable'; | import Loadable from 'components/Loadable'; | ||||
const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/LoadingComponent'))); | const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/LoadingComponent'))); | ||||
import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' | import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' | ||||
// import ForwardIcon from '@mui/icons-material/Forward'; | |||||
import MainCard from 'components/MainCard'; | import MainCard from 'components/MainCard'; | ||||
// import {PNSPS_LONG_BUTTON_THEME} from "themes/buttonConst"; | |||||
// import {ThemeProvider} from "@emotion/react"; | |||||
import {FormattedMessage, | import {FormattedMessage, | ||||
// useIntl | |||||
} from "react-intl"; | } from "react-intl"; | ||||
// import { EyeInvisibleOutlined, EyeOutlined } from '@ant-design/icons'; | |||||
// import axios from 'axios'; | |||||
import { | import { | ||||
// useParams, | |||||
Link | Link | ||||
} from 'react-router-dom'; | } from 'react-router-dom'; | ||||
import CheckCircleOutlineIcon from '@mui/icons-material/CheckCircleOutline'; | import CheckCircleOutlineIcon from '@mui/icons-material/CheckCircleOutline'; | ||||
// import LocaleContext from "components/I18nProvider"; | |||||
// ==============================|| DASHBOARD - DEFAULT ||============================== // | // ==============================|| DASHBOARD - DEFAULT ||============================== // | ||||
const ResetPasswordSuccess = () => { | const ResetPasswordSuccess = () => { | ||||
// const dispatch = useDispatch() | |||||
// const navigate = useNavigate() | |||||
const [isLoading, setLoding] = React.useState(true); | const [isLoading, setLoding] = React.useState(true); | ||||
// const params = useParams() | |||||
// const intl = useIntl(); | |||||
React.useEffect(() => { | React.useEffect(() => { | ||||
// console.log(params); | |||||
setLoding(false) | setLoding(false) | ||||
}, []); | }, []); | ||||
// React.useEffect(() => { | |||||
// // console.log("if (enterUseEffect) handleVerify()"); | |||||
// if (enterUseEffect){ | |||||
// handleVerify() | |||||
// } | |||||
// }, [enterUseEffect]) | |||||
const BackgroundHead = { | const BackgroundHead = { | ||||
backgroundImage: `url(${titleBackgroundImg})`, | backgroundImage: `url(${titleBackgroundImg})`, | ||||
width: 'auto', | width: 'auto', | ||||
@@ -37,7 +37,6 @@ import { EyeInvisibleOutlined, EyeOutlined } from '@ant-design/icons'; | |||||
import axios from 'axios'; | import axios from 'axios'; | ||||
import { useParams,Link } from 'react-router-dom'; | import { useParams,Link } from 'react-router-dom'; | ||||
import CancelOutlinedIcon from '@mui/icons-material/CancelOutlined'; | import CancelOutlinedIcon from '@mui/icons-material/CancelOutlined'; | ||||
// import LocaleContext from "components/I18nProvider"; | |||||
// ==============================|| DASHBOARD - DEFAULT ||============================== // | // ==============================|| DASHBOARD - DEFAULT ||============================== // | ||||
@@ -1,17 +1,12 @@ | |||||
import React, { | import React, { | ||||
// useContext, | |||||
useEffect, useState} from 'react'; | useEffect, useState} from 'react'; | ||||
import {useNavigate} from 'react-router-dom'; | import {useNavigate} from 'react-router-dom'; | ||||
// material-ui | // material-ui | ||||
import { | import { | ||||
Button, | Button, | ||||
//Checkbox, | |||||
//Divider, | |||||
//FormControlLabel, | |||||
FormHelperText, | FormHelperText, | ||||
Grid, | Grid, | ||||
//Link, | |||||
IconButton, | IconButton, | ||||
InputAdornment, | InputAdornment, | ||||
InputLabel, | InputLabel, | ||||
@@ -25,9 +20,7 @@ import * as Yup from 'yup'; | |||||
import { Formik } from 'formik'; | import { Formik } from 'formik'; | ||||
// project import | // project import | ||||
//import FirebaseSocial from './FirebaseSocial'; | |||||
import AnimateButton from 'components/@extended/AnimateButton'; | import AnimateButton from 'components/@extended/AnimateButton'; | ||||
//import {AbilityContext} from "@src/utility/context/Can" | |||||
import {apiPath} from "auth/utils"; | import {apiPath} from "auth/utils"; | ||||
import {POST_LOGIN} from "utils/ApiPathConst"; | import {POST_LOGIN} from "utils/ApiPathConst"; | ||||
@@ -36,9 +29,7 @@ import { EyeOutlined, EyeInvisibleOutlined } from '@ant-design/icons'; | |||||
import axios from "axios"; | import axios from "axios"; | ||||
import {useDispatch} from "react-redux"; | import {useDispatch} from "react-redux"; | ||||
import {handleLogin} from "auth/index"; | import {handleLogin} from "auth/index"; | ||||
// import { notifyActionSuccess } from 'utils/CommonFunction'; | |||||
import {FormattedMessage} from "react-intl"; | import {FormattedMessage} from "react-intl"; | ||||
// import LocaleContext from "../../../components/I18nProvider"; | |||||
// ============================|| FIREBASE - LOGIN ||============================ // | // ============================|| FIREBASE - LOGIN ||============================ // | ||||
const AuthLogin = () => { | const AuthLogin = () => { | ||||
@@ -224,14 +215,6 @@ const AuthLogin = () => { | |||||
</Button> | </Button> | ||||
</AnimateButton> | </AnimateButton> | ||||
</Grid> | </Grid> | ||||
{/*<Grid item xs={12}>*/} | |||||
{/* <Divider>*/} | |||||
{/* <Typography variant="caption"> Login with</Typography>*/} | |||||
{/* </Divider>*/} | |||||
{/*</Grid>*/} | |||||
{/*<Grid item xs={12}>*/} | |||||
{/* <FirebaseSocial />*/} | |||||
{/*</Grid>*/} | |||||
</Grid> | </Grid> | ||||
</form> | </form> | ||||
)} | )} | ||||
@@ -2,7 +2,7 @@ import { | |||||
useEffect, | useEffect, | ||||
useState, | useState, | ||||
lazy, | lazy, | ||||
// useContext | |||||
useContext | |||||
} from 'react'; | } from 'react'; | ||||
import { Link as RouterLink } from 'react-router-dom'; | import { Link as RouterLink } from 'react-router-dom'; | ||||
import { useNavigate } 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 * as HttpUtils from "utils/HttpUtils"; | ||||
import { I_AM_SMART_PATH } from "utils/ApiPathConst"; | import { I_AM_SMART_PATH } from "utils/ApiPathConst"; | ||||
//iAmSmartAppPath | |||||
// material-ui | // material-ui | ||||
import { | import { | ||||
Button, | Button, | ||||
//Checkbox, | |||||
//Divider, | |||||
//FormControlLabel, | |||||
FormHelperText, | FormHelperText, | ||||
Grid, | Grid, | ||||
Link, | Link, | ||||
@@ -35,8 +31,6 @@ import { | |||||
import * as yup from 'yup'; | import * as yup from 'yup'; | ||||
import { useFormik, FormikProvider } from 'formik'; | import { useFormik, FormikProvider } from 'formik'; | ||||
// project import | |||||
//import FirebaseSocial from './FirebaseSocial'; | |||||
import AnimateButton from 'components/@extended/AnimateButton'; | import AnimateButton from 'components/@extended/AnimateButton'; | ||||
import Loadable from 'components/Loadable'; | import Loadable from 'components/Loadable'; | ||||
const PasswordAlertDialog = Loadable(lazy(() => import('./PasswordAlertDialog'))); | const PasswordAlertDialog = Loadable(lazy(() => import('./PasswordAlertDialog'))); | ||||
@@ -49,9 +43,9 @@ import { handleLogin } from "auth/index"; | |||||
import useJwt from "auth/jwt/useJwt"; | import useJwt from "auth/jwt/useJwt"; | ||||
import { handleLogoutFunction } from 'auth/index'; | import { handleLogoutFunction } from 'auth/index'; | ||||
import { FormattedMessage, useIntl } from "react-intl"; | 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'))); | const LoadingComponent = Loadable(lazy(() => import('pages/extra-pages/LoadingComponent'))); | ||||
// ============================|| FIREBASE - LOGIN ||============================ // | // ============================|| FIREBASE - LOGIN ||============================ // | ||||
@@ -61,14 +55,13 @@ const AuthLoginCustom = () => { | |||||
const navigate = useNavigate() | const navigate = useNavigate() | ||||
const intl = useIntl(); | const intl = useIntl(); | ||||
const { locale } = intl; | const { locale } = intl; | ||||
// const { setLocaleFromLogin } = useContext(LocaleContext); | |||||
const { sysSetting } = useContext(SysContext); | |||||
const [showPassword, setShowPassword] = useState(false); | const [showPassword, setShowPassword] = useState(false); | ||||
const handleClickShowPassword = () => { | const handleClickShowPassword = () => { | ||||
setShowPassword(!showPassword); | setShowPassword(!showPassword); | ||||
}; | }; | ||||
// let [posts, setPosts] = useState([]); | |||||
const [isValid, setisValid] = useState(false); | const [isValid, setisValid] = useState(false); | ||||
const [open, setOpen] = useState(false); | const [open, setOpen] = useState(false); | ||||
const [isButtonDisabled, setIsButtonDisabled] = useState(true); | const [isButtonDisabled, setIsButtonDisabled] = useState(true); | ||||
@@ -149,7 +142,6 @@ const AuthLoginCustom = () => { | |||||
submit: null | submit: null | ||||
}), | }), | ||||
validationSchema: yup.object().shape({ | validationSchema: yup.object().shape({ | ||||
// username: yup.string().min(6,'用戶名稱最少6位').required('請輸入用戶名稱'), | |||||
username: yup.string().required(intl.formatMessage({ id: 'requireUsername' })), | username: yup.string().required(intl.formatMessage({ id: 'requireUsername' })), | ||||
password: yup.string().min(8, intl.formatMessage({ id: 'atLeast8CharPassword' })).required(intl.formatMessage({ id: 'requirePassword' })) | password: yup.string().min(8, intl.formatMessage({ id: 'atLeast8CharPassword' })).required(intl.formatMessage({ id: 'requirePassword' })) | ||||
.matches(/^(?=.*[a-z])/, intl.formatMessage({ id: 'atLeastOneSmallLetter' })) | .matches(/^(?=.*[a-z])/, intl.formatMessage({ id: 'atLeastOneSmallLetter' })) | ||||
@@ -208,7 +200,7 @@ const AuthLoginCustom = () => { | |||||
const { handleSubmit } = useForm({}) | const { handleSubmit } = useForm({}) | ||||
function getQRWithIAmSmart(){ | |||||
function getQRWithIAmSmart() { | |||||
if (isAppBowser()) { | if (isAppBowser()) { | ||||
openApp(); | openApp(); | ||||
} else { | } else { | ||||
@@ -231,10 +223,10 @@ const AuthLoginCustom = () => { | |||||
+ "&lang=" + (locale === 'en' ? "en-US" : locale === 'zh-HK' ? "zh-HK" : "zh-CN") | + "&lang=" + (locale === 'en' ? "en-US" : locale === 'zh-HK' ? "zh-HK" : "zh-CN") | ||||
//+"&state=" | //+"&state=" | ||||
+ "&brokerPage=false" | + "&brokerPage=false" | ||||
window.location = url; | |||||
window.location = url; | |||||
} | } | ||||
}); | }); | ||||
} | } | ||||
const openApp = () => { | const openApp = () => { | ||||
@@ -269,7 +261,7 @@ const AuthLoginCustom = () => { | |||||
+ "&lang=" + (locale === 'en' ? "en-US" : locale === 'zh-HK' ? "zh-HK" : "zh-CN") | + "&lang=" + (locale === 'en' ? "en-US" : locale === 'zh-HK' ? "zh-HK" : "zh-CN") | ||||
//+"&state=" | //+"&state=" | ||||
+ "&brokerPage=false" | + "&brokerPage=false" | ||||
window.location = url; | |||||
window.location = url; | |||||
} | } | ||||
}); | }); | ||||
@@ -393,35 +385,44 @@ const AuthLoginCustom = () => { | |||||
</Grid> | </Grid> | ||||
</Grid> | </Grid> | ||||
</Grid> | </Grid> | ||||
<Grid item xs={12}> | |||||
<Grid container> | |||||
<Grid item xs={12}> | |||||
<Stack direction="row" justifyContent="space-between" alignItems="center" spacing={2}> | |||||
<IAmSmartButton | |||||
label={intl.formatMessage({ id: "iAmSmartLogin" })} | |||||
onClickFun={getQRWithIAmSmart} | |||||
fullWidth={true} | |||||
/> | |||||
</Stack> | |||||
</Grid> | |||||
<Grid item xs={12}> | |||||
<Stack direction="row" justifyContent="space-between" alignItems="center" spacing={2}> | |||||
<Link href={intl.formatMessage({ id: "iamsmartLink" })} color="primary" sx={{ textDecoration: "none" }}> | |||||
<Typography align="center" variant="h7"> | |||||
{intl.formatMessage({ id: 'learnMore' }) + " >"} | |||||
</Typography> | |||||
</Link> | |||||
</Stack> | |||||
</Grid> | |||||
</Grid> | |||||
</Grid> | |||||
<Grid item xs={12}> | |||||
<Stack direction="row" justifyContent="space-between" alignItems="center" spacing={2}> | |||||
<Button fullWidth size="large" variant="outlined" href="/register" ><Typography variant="h5"> | |||||
<FormattedMessage id="createOrReActivate" /> | |||||
</Typography></Button> | |||||
</Stack> | |||||
</Grid> | |||||
{ | |||||
sysSetting?.allowRegistration ? | |||||
<> | |||||
<Grid item xs={12} > | |||||
<Grid container> | |||||
<Grid item xs={12}> | |||||
<Stack direction="row" justifyContent="space-between" alignItems="center" spacing={2}> | |||||
<IAmSmartButton | |||||
label={intl.formatMessage({ id: "iAmSmartLogin" })} | |||||
onClickFun={getQRWithIAmSmart} | |||||
fullWidth={true} | |||||
/> | |||||
</Stack> | |||||
</Grid> | |||||
<Grid item xs={12}> | |||||
<Stack direction="row" justifyContent="space-between" alignItems="center" spacing={2}> | |||||
<Link href={intl.formatMessage({ id: "iamsmartLink" })} color="primary" sx={{ textDecoration: "none" }}> | |||||
<Typography align="center" variant="h7"> | |||||
{intl.formatMessage({ id: 'learnMore' }) + " >"} | |||||
</Typography> | |||||
</Link> | |||||
</Stack> | |||||
</Grid> | |||||
</Grid> | |||||
</Grid> | |||||
<Grid item xs={12}> | |||||
<Stack direction="row" justifyContent="space-between" alignItems="center" spacing={2}> | |||||
<Button fullWidth size="large" variant="outlined" href="/register" ><Typography variant="h5"> | |||||
<FormattedMessage id="createOrReActivate" /> | |||||
</Typography></Button> | |||||
</Stack> | |||||
</Grid> | |||||
</> | |||||
: | |||||
<></> | |||||
} | |||||
</Grid> | </Grid> | ||||
<PasswordAlertDialog open={open} handleClose={handleClose} errorMassage={errorMassage} /> | <PasswordAlertDialog open={open} handleClose={handleClose} errorMassage={errorMassage} /> | ||||
</form> | </form> | ||||
@@ -1,4 +1,5 @@ | |||||
import { lazy } from 'react'; | |||||
import { lazy, useContext } from 'react'; | |||||
import { SysContext } from "components/SysSettingProvider" | |||||
// project import | // project import | ||||
import Loadable from 'components/Loadable'; | import Loadable from 'components/Loadable'; | ||||
@@ -39,111 +40,121 @@ const Payment_FPS_CallBack = Loadable(lazy(() => import('pages/Payment/FPS/fpsca | |||||
// ==============================|| AUTH ROUTING ||============================== // | // ==============================|| AUTH ROUTING ||============================== // | ||||
const LoginRoutes = { | |||||
path: '/', | |||||
element: <MainLayout />, | |||||
children: [ | |||||
{ | |||||
path: 'login', | |||||
element: <AuthLogin /> | |||||
}, | |||||
{ | |||||
path: 'register', | |||||
element: <AuthRegister /> | |||||
}, | |||||
{ | |||||
path: 'registerFrom', | |||||
element: <RegisterForm /> | |||||
}, | |||||
{ | |||||
path: 'registerFromOrganization', | |||||
element: <BusRegisterForm /> | |||||
}, | |||||
{ | |||||
path: 'iAmSmartRegisterFrom', | |||||
element: <IAmSmartRegister /> | |||||
}, | |||||
{ | |||||
path: 'error', | |||||
element: <ErrorPage/> | |||||
}, | |||||
{ | |||||
path: 'privacyPolicy', | |||||
element: <PrivacyPolicyPage/> | |||||
}, | |||||
{ | |||||
path: 'aboutUs', | |||||
element: <AboutUsPage/> | |||||
}, | |||||
{ | |||||
path: 'iamsmart/logincallback', | |||||
element: <IAmSmart_DirectLoginCallback/> | |||||
}, | |||||
{ | |||||
path: 'iamsmart/loginfallback', | |||||
element: <IAmSmart_FailCallback/> | |||||
}, | |||||
{ | |||||
path: 'iamsmart/notverify', | |||||
element: <FailCallback_VerifyMail/> | |||||
}, | |||||
{ | |||||
path: 'iamsmart/authcallback', | |||||
element: <IAmSmart_AuthCallback/> | |||||
}, | |||||
{ | |||||
path: 'iamsmart/registrycallback', | |||||
element: <IAmSmart_RegistryCallback/> | |||||
}, | |||||
{ | |||||
path: 'iamsmart/loginFail', | |||||
element: <IAmSmart_FailCallback/> | |||||
}, | |||||
{ | |||||
path: 'verify/:verifyCode/:email', | |||||
element: <VerifyPage/> | |||||
}, | |||||
{ | |||||
path: 'testfps', | |||||
element: <Testfps/> | |||||
}, | |||||
{ | |||||
path: 'testfpscallback', | |||||
element: <Payment_FPS_CallBack/> | |||||
}, | |||||
{ | |||||
path: 'forgot/password', | |||||
element: <ForgotPassword/> | |||||
}, | |||||
{ | |||||
path: 'forgot/password/sent', | |||||
element: <AfterForgotPasswordPage/> | |||||
}, | |||||
{ | |||||
path: 'forgot/password/verify/:verifyCode/:email', | |||||
element: <ForgotPassword_Callback/> | |||||
}, | |||||
{ | |||||
path: 'forgot/password/success', | |||||
element: <ForgotPassword_Success/> | |||||
}, | |||||
{ | |||||
path: 'forgot/username', | |||||
element: <ForgotUsername/> | |||||
}, | |||||
{ | |||||
path: 'forgot/username/sent', | |||||
element: <AfterForgotUsernamePage/> | |||||
}, | |||||
{ | |||||
path: 'forgot/username/verify/:verifyCode/:email', | |||||
element: <ForgotUsername_Callback/> | |||||
}, | |||||
{ | |||||
path: 'forgot/username/success', | |||||
element: <ForgotUsername_Success/> | |||||
}, | |||||
] | |||||
}; | |||||
export default function LoginRoutes(){ | |||||
const { sysSetting } = useContext(SysContext); | |||||
return { | |||||
path: '/', | |||||
element: <MainLayout />, | |||||
children: [ | |||||
{ | |||||
path: 'login', | |||||
element: <AuthLogin /> | |||||
}, | |||||
... sysSetting?.allowRegistration ?[ | |||||
{ | |||||
path: 'register', | |||||
element: <AuthRegister /> | |||||
}, | |||||
{ | |||||
path: 'registerFrom', | |||||
element: <RegisterForm /> | |||||
}, | |||||
{ | |||||
path: 'registerFromOrganization', | |||||
element: <BusRegisterForm /> | |||||
}, | |||||
{ | |||||
path: 'iAmSmartRegisterFrom', | |||||
element: <IAmSmartRegister /> | |||||
}, | |||||
{ | |||||
path: 'iamsmart/registrycallback', | |||||
element: <IAmSmart_RegistryCallback/> | |||||
}, | |||||
{ | |||||
path: 'verify/:verifyCode/:email', | |||||
element: <VerifyPage/> | |||||
}, | |||||
]:[] | |||||
, | |||||
{ | |||||
path: 'error', | |||||
element: <ErrorPage/> | |||||
}, | |||||
{ | |||||
path: 'privacyPolicy', | |||||
element: <PrivacyPolicyPage/> | |||||
}, | |||||
{ | |||||
path: 'aboutUs', | |||||
element: <AboutUsPage/> | |||||
}, | |||||
{ | |||||
path: 'iamsmart/logincallback', | |||||
element: <IAmSmart_DirectLoginCallback/> | |||||
}, | |||||
{ | |||||
path: 'iamsmart/loginfallback', | |||||
element: <IAmSmart_FailCallback/> | |||||
}, | |||||
{ | |||||
path: 'iamsmart/notverify', | |||||
element: <FailCallback_VerifyMail/> | |||||
}, | |||||
{ | |||||
path: 'iamsmart/authcallback', | |||||
element: <IAmSmart_AuthCallback/> | |||||
}, | |||||
{ | |||||
path: 'iamsmart/loginFail', | |||||
element: <IAmSmart_FailCallback/> | |||||
}, | |||||
{ | |||||
path: 'testfps', | |||||
element: <Testfps/> | |||||
}, | |||||
{ | |||||
path: 'testfpscallback', | |||||
element: <Payment_FPS_CallBack/> | |||||
}, | |||||
{ | |||||
path: 'forgot/password', | |||||
element: <ForgotPassword/> | |||||
}, | |||||
{ | |||||
path: 'forgot/password/sent', | |||||
element: <AfterForgotPasswordPage/> | |||||
}, | |||||
{ | |||||
path: 'forgot/password/verify/:verifyCode/:email', | |||||
element: <ForgotPassword_Callback/> | |||||
}, | |||||
{ | |||||
path: 'forgot/password/success', | |||||
element: <ForgotPassword_Success/> | |||||
}, | |||||
{ | |||||
path: 'forgot/username', | |||||
element: <ForgotUsername/> | |||||
}, | |||||
{ | |||||
path: 'forgot/username/sent', | |||||
element: <AfterForgotUsernamePage/> | |||||
}, | |||||
{ | |||||
path: 'forgot/username/verify/:verifyCode/:email', | |||||
element: <ForgotUsername_Callback/> | |||||
}, | |||||
{ | |||||
path: 'forgot/username/success', | |||||
element: <ForgotUsername_Success/> | |||||
}, | |||||
] | |||||
}; | |||||
} | |||||
// export default LoginRoutes; | |||||
export default LoginRoutes; |
@@ -51,9 +51,9 @@ export default function ThemeRoutes() { | |||||
path: '/dashboard', | path: '/dashboard', | ||||
element: <Navigate to="/login" /> | element: <Navigate to="/login" /> | ||||
}, | }, | ||||
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() ? { | !isUserLoggedIn() ? { | ||||
path: '*', | path: '*', | ||||
element: <Navigate to="/login" /> | element: <Navigate to="/login" /> | ||||
@@ -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_PATH = apiPath+'/smart/call/iAmSmart'; | ||||
export const I_AM_SMART_APP_PATH = apiPath+'/smart/call/app/iAmSmart'; | export const I_AM_SMART_APP_PATH = apiPath+'/smart/call/app/iAmSmart'; | ||||
export const GET_SYS_SETTING = apiPath+'/sys'; | |||||
//Group Config | //Group Config | ||||
export const GET_GROUP_LIST_PATH = apiPath+'/group'; | export const GET_GROUP_LIST_PATH = apiPath+'/group'; | ||||