@@ -67,7 +67,7 @@ const Index = () => { | |||
// } | |||
// } | |||
dispatch(handleLogin(data)) | |||
navigate('/dashboard'); | |||
navigate('iamsmart/loginSucess', {state:{loginMethod:"iAmSmart"}}); | |||
}, | |||
onFail: (response)=>{ | |||
console.log("onFail"); | |||
@@ -3,9 +3,12 @@ import { | |||
Grid, | |||
Typography, | |||
Stack, | |||
Button | |||
} from '@mui/material'; | |||
import * as React from "react"; | |||
import { FormattedMessage } from "react-intl"; | |||
import { useLocation } from "react-router-dom"; | |||
import { useNavigate } from "react-router-dom"; | |||
import Loadable from 'components/Loadable'; | |||
const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/LoadingComponent'))); | |||
@@ -23,11 +26,16 @@ const BackgroundHead = { | |||
// ==============================|| DASHBOARD - DEFAULT ||============================== // | |||
const Index = () => { | |||
const location = useLocation(); | |||
const navigate = useNavigate() | |||
const [onReady, setOnReady] = React.useState(false); | |||
React.useEffect(() => { | |||
setOnReady(true); | |||
if("iAmSmart"==location.state.loginMethod){ | |||
setOnReady(true); | |||
}else{ | |||
navigate('/dashboard'); | |||
} | |||
}, []); | |||
return ( | |||
@@ -42,7 +50,9 @@ const Index = () => { | |||
<Grid item xs={12} width="100%"> | |||
<div style={BackgroundHead} width="100%"> | |||
<Stack direction="row" height='70px'> | |||
<Typography ml={15} color='#FFF' variant="h4" sx={{ pt: 2 }}>iAM Smart 成功登入</Typography> | |||
<Typography ml={15} color='#FFF' variant="h4" sx={{ pt: 2 }}> | |||
<FormattedMessage id="loginSuccessMessage1" /> | |||
</Typography> | |||
</Stack> | |||
</div> | |||
</Grid> | |||
@@ -51,18 +61,31 @@ const Index = () => { | |||
<Grid container justifyContent="flex-start" alignItems="center" > | |||
<center> | |||
<Grid item xs={12} md={12} > | |||
<Typography variant="h3" sx={{ ml: 8, mt: 4, mr: 8, textAlign: "center" }}> | |||
iAM Smart 成功登入 | |||
<FormattedMessage id="loginSuccessMessage2" /> | |||
</Typography> | |||
</Grid> | |||
</center> | |||
</Grid> | |||
</Grid> | |||
{/*row 2*/} | |||
<Grid item xs={12} md={12} > | |||
<Grid container justifyContent="flex-start" alignItems="center" > | |||
<center> | |||
<Button | |||
component="span" | |||
variant="contained" | |||
size="large" | |||
sx={{ m: 4 }} | |||
onClick={() => { navigate("/dashboard"); }} | |||
> | |||
<FormattedMessage id="loginSuccessMessage3" /> | |||
</Button> | |||
</center> | |||
</Grid> | |||
</Grid> | |||
</Grid > | |||
); | |||
}; | |||
@@ -5,6 +5,7 @@ import Loadable from 'components/Loadable'; | |||
import { Navigate } from "react-router"; | |||
const MainLayout = Loadable(lazy(() => import('layout/MainLayout'))); | |||
const IAmSmart_SuccessCallback = Loadable(lazy(() => import('pages/iAmSmart/SuccessCallback'))); | |||
// ==============================|| MAIN ROUTING ||============================== // | |||
@@ -42,7 +43,7 @@ const AfterLoginRoutes = { | |||
}, | |||
{ | |||
path: 'iamsmart/loginSucess', | |||
element: <Navigate to="/dashboard" /> | |||
element: <IAmSmart_SuccessCallback/> | |||
}, | |||
{ | |||
path: 'verify/:verifyCode/:email', | |||
@@ -27,7 +27,6 @@ const IAmSmart_DirectLoginCallback = Loadable(lazy(() => import('pages/iAmSmart/ | |||
//const IAmSmart_FallCallback = Loadable(lazy(() => import('pages/iAmSmart/FallCallback'))); | |||
const IAmSmart_FailCallback = Loadable(lazy(() => import('pages/iAmSmart/FailCallback'))); | |||
const FailCallback_VerifyMail = Loadable(lazy(() => import('pages/iAmSmart/FailCallback_VerifyMail'))); | |||
const IAmSmart_SuccessCallback = Loadable(lazy(() => import('pages/iAmSmart/SuccessCallback'))); | |||
const IAmSmart_AuthCallback = Loadable(lazy(() => import('pages/iAmSmart/AuthCallback'))); | |||
const IAmSmart_RegistryCallback = Loadable(lazy(() => import('pages/iAmSmart/RegistryCallback'))); | |||
@@ -90,10 +89,6 @@ const LoginRoutes = { | |||
path: 'iamsmart/loginFail', | |||
element: <IAmSmart_FailCallback/> | |||
}, | |||
{ | |||
path: 'iamsmart/loginSucess', | |||
element: <IAmSmart_SuccessCallback/> | |||
}, | |||
{ | |||
path: 'verify/:verifyCode/:email', | |||
element: <VerifyPage/> | |||
@@ -152,7 +152,11 @@ | |||
"loginErrorMessage3":"Account has not been Verified", | |||
"loginErrorMessage4":"System Connection Failed", | |||
"loginErrorMessage5":"Incorrect Username or Password", | |||
"loginErrorMessage6":"Login fail, please try again", | |||
"loginErrorMessage6":"User account not found", | |||
"loginSuccessMessage1":"User account not found", | |||
"loginSuccessMessage2":"You are our existing user and successfully linked your existing account. From now on, you can log in through \"iAm Smart\".", | |||
"loginSuccessMessage3":"Continue to use e-Service", | |||
"newPassword": "New Password", | |||
"setNewPassword": "Please enter new password", | |||
@@ -178,7 +178,11 @@ | |||
"loginErrorMessage3":"帐户尚未验证", | |||
"loginErrorMessage4":"系统连接失败", | |||
"loginErrorMessage5":"用户名或密码错误", | |||
"loginErrorMessage6":"登入失败,请重试", | |||
"loginErrorMessage6":"找不到用户帐户", | |||
"loginSuccessMessage1":"成功连结现有帐户", | |||
"loginSuccessMessage2":"你是我们的现有用户,已成功连结现有帐户,以后可以透过「智方便」登入。", | |||
"loginSuccessMessage3":"继续使用e-Service", | |||
"newPassword": "新密码", | |||
"setNewPassword": "请输入新密码", | |||
@@ -197,7 +201,7 @@ | |||
"requireSecurityCode": "请输入安全验证码", | |||
"learnMore": "了解更多", | |||
"createOrReActivate": "建立帐户", | |||
"usernameTaken": "此用户登入名称已被注册,请使用其他用户登入名称", | |||
"usernameTaken": "此用户登入名称已被注册,请使用其他用户登入名称。", | |||
"userRegistered": "此用户已注册,请返回登入页面并进行登入流程。", | |||
"user": "用戶", | |||
@@ -179,7 +179,11 @@ | |||
"loginErrorMessage3":"帳戶尚未驗證", | |||
"loginErrorMessage4":"系統連接失敗", | |||
"loginErrorMessage5":"用戶名或密碼錯誤", | |||
"loginErrorMessage6":"登入失敗,請重試", | |||
"loginErrorMessage6":"找不到用戶帳戶", | |||
"loginSuccessMessage1":"成功連結現有帳戶", | |||
"loginSuccessMessage2":"你是我們的現有用戶,已成功連結現有帳戶,以後可以透過「智方便」登入。", | |||
"loginSuccessMessage3":"繼續使用e-Service", | |||
"newPassword": "新密碼", | |||
"setNewPassword": "請輸入新密碼", | |||