diff --git a/src/pages/iAmSmart/AuthCallback/index.js b/src/pages/iAmSmart/AuthCallback/index.js index 39772ce..ac6c156 100644 --- a/src/pages/iAmSmart/AuthCallback/index.js +++ b/src/pages/iAmSmart/AuthCallback/index.js @@ -70,16 +70,22 @@ const Index = () => { navigate('/dashboard'); }, onFail: (response)=>{ - console.log("Fail"); + console.log("onFail"); console.log(response); window.location.assign("/iamsmart/loginFail"); }, onError:(error)=>{ + console.log("onError"); console.log(error); - window.location.assign("/iamsmart/loginFail"); + if(error?.response?.data?.exception == "msg: please verify email."){ + window.location.assign("/iamsmart/notverify"); + }else{ + window.location.assign("/iamsmart/loginFail"); + } } }); }else{ + console.log("Fail"); window.location.assign("/iamsmart/loginFail"); } } diff --git a/src/pages/iAmSmart/DirectLoginCallback/index.js b/src/pages/iAmSmart/DirectLoginCallback/index.js index 788d3ff..0ee31d8 100644 --- a/src/pages/iAmSmart/DirectLoginCallback/index.js +++ b/src/pages/iAmSmart/DirectLoginCallback/index.js @@ -57,8 +57,13 @@ const Index = () => { window.location.assign("/iamsmart/loginFail"); }, onError:(error)=>{ + console.log("onError"); console.log(error); - window.location.assign("/iamsmart/loginFail"); + if(error?.response?.data?.exception == "msg: please verify email."){ + window.location.assign("/iamsmart/notverify"); + }else{ + window.location.assign("/iamsmart/loginFail"); + } } }); }else{ diff --git a/src/pages/iAmSmart/FailCallback/index.js b/src/pages/iAmSmart/FailCallback/index.js index 0fe09dc..1d5da8f 100644 --- a/src/pages/iAmSmart/FailCallback/index.js +++ b/src/pages/iAmSmart/FailCallback/index.js @@ -6,7 +6,7 @@ import { } from '@mui/material'; import * as React from "react"; import { useNavigate } from "react-router-dom"; - +import { FormattedMessage } from "react-intl"; import Loadable from 'components/Loadable'; const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/LoadingComponent'))); @@ -30,32 +30,42 @@ const Index = () => { : - - - - -
- - - - 登入失敗,請重試。 - - - - -
-
+ + + + +
+ + + + + + + + + + +
- {/*row 2*/} -
+
+ {/*row 2*/} +
); }; diff --git a/src/pages/iAmSmart/FailCallback_VerifyMail/index.js b/src/pages/iAmSmart/FailCallback_VerifyMail/index.js new file mode 100644 index 0000000..5c4f1f5 --- /dev/null +++ b/src/pages/iAmSmart/FailCallback_VerifyMail/index.js @@ -0,0 +1,69 @@ +// material-ui +import { + Grid, + Typography, + Button +} from '@mui/material'; +import * as React from "react"; +import { useNavigate } from "react-router-dom"; +import { FormattedMessage } from "react-intl"; +import Loadable from 'components/Loadable'; +const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/LoadingComponent'))); + + +// ==============================|| DASHBOARD - DEFAULT ||============================== // + +const Index = () => { + + const navigate = useNavigate() + const [onReady, setOnReady] = React.useState(false); + + React.useEffect(() => { + setOnReady(true); + }, []); + + return ( + !onReady ? + + + + + + : + + + + +
+ + + + + + + + + + + + + + +
+
+
+ {/*row 2*/} +
+ + ); +}; + +export default Index; \ No newline at end of file diff --git a/src/routes/LoginRoutes.js b/src/routes/LoginRoutes.js index 103ae75..cd36718 100644 --- a/src/routes/LoginRoutes.js +++ b/src/routes/LoginRoutes.js @@ -26,6 +26,7 @@ const ForgotUsername_Success = Loadable(lazy(() => import('pages/authentication/ const IAmSmart_DirectLoginCallback = Loadable(lazy(() => import('pages/iAmSmart/DirectLoginCallback'))); //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'))); @@ -73,6 +74,10 @@ const LoginRoutes = { path: 'iamsmart/loginfallback', element: }, + { + path: 'iamsmart/notverify', + element: + }, { path: 'iamsmart/authcallback', element: diff --git a/src/translations/en.json b/src/translations/en.json index 9b84f9a..09c8444 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -84,6 +84,7 @@ "continue": "Continue", "submit": "Submit", "backToLogin": "Return to login page", + "goRegister": "Register an account", "registerSubmitted": "Account application submitted successfully.", "registerFail": "Application failed, please try again later", "iAmSmartNoIdNoMsg": "Invalid information, please return to the registration page.", @@ -125,6 +126,7 @@ "loginErrorMessage3":"Account has not been Verified", "loginErrorMessage4":"System Connection Failed", "loginErrorMessage5":"Incorrect Username or Password", + "loginErrorMessage6":"Login fail, please try again", "newPassword": "New Password", "setNewPassword": "Please enter new password", diff --git a/src/translations/zh-CN.json b/src/translations/zh-CN.json index 65645c7..dca0c9d 100644 --- a/src/translations/zh-CN.json +++ b/src/translations/zh-CN.json @@ -83,6 +83,7 @@ "continue": "继续", "submit": "提交", "backToLogin": "返回登入页面", + "goRegister": "帐户申请", "registerSubmitted": "帐户申请已成功提交。", "registerFail": "申请失败,请稍后尝试", "iAmSmartNoIdNoMsg": "无效资料,请返回注册页面。", @@ -123,6 +124,7 @@ "loginErrorMessage3":"帐户尚未验证", "loginErrorMessage4":"系统连接失败", "loginErrorMessage5":"用户名或密码错误", + "loginErrorMessage6":"登入失败,请重试", "newPassword": "新密码", "setNewPassword": "请输入新密码", diff --git a/src/translations/zh-HK.json b/src/translations/zh-HK.json index a9a5a5c..1d3572e 100644 --- a/src/translations/zh-HK.json +++ b/src/translations/zh-HK.json @@ -83,6 +83,7 @@ "continue": "繼續", "submit": "提交", "backToLogin": "返回登入頁面", + "goRegister": "帳戶申請", "registerSubmitted": "帳戶申請已成功提交。", "registerFail": "申請失敗,請稍後嘗試", "iAmSmartNoIdNoMsg": "無效資料,請返回注冊頁面。", @@ -123,6 +124,7 @@ "loginErrorMessage3":"帳戶尚未驗證", "loginErrorMessage4":"系統連接失敗", "loginErrorMessage5":"用戶名或密碼錯誤", + "loginErrorMessage6":"登入失敗,請重試", "newPassword": "新密碼", "setNewPassword": "請輸入新密碼",