Pārlūkot izejas kodu

Merge branch 'master' into paymentApi

master
Alex Cheung pirms 1 gada
vecāks
revīzija
96d91a4146
8 mainītis faili ar 130 papildinājumiem un 29 dzēšanām
  1. +8
    -2
      src/pages/iAmSmart/AuthCallback/index.js
  2. +6
    -1
      src/pages/iAmSmart/DirectLoginCallback/index.js
  3. +36
    -26
      src/pages/iAmSmart/FailCallback/index.js
  4. +69
    -0
      src/pages/iAmSmart/FailCallback_VerifyMail/index.js
  5. +5
    -0
      src/routes/LoginRoutes.js
  6. +2
    -0
      src/translations/en.json
  7. +2
    -0
      src/translations/zh-CN.json
  8. +2
    -0
      src/translations/zh-HK.json

+ 8
- 2
src/pages/iAmSmart/AuthCallback/index.js Parādīt failu

@@ -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");
}
}


+ 6
- 1
src/pages/iAmSmart/DirectLoginCallback/index.js Parādīt failu

@@ -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{


+ 36
- 26
src/pages/iAmSmart/FailCallback/index.js Parādīt failu

@@ -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 = () => {
</Grid>
</Grid>
:
<Grid container sx={{ height: '100%', backgroundColor: '#fff' }} direction="column" justifyContent="flex-start" alignItems="center" >
<Grid item xs={12} md={12} >
<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" }}>
登入失敗,請重試。
</Typography>
<Button
component="span"
variant="contained"
size="large"
sx={{ m: 4 }}
onClick={() => {
navigate("/login");
}}
>返回登入</Button>

</Grid>
</center>
</Grid>

<Grid container sx={{ height: '100%', backgroundColor: '#fff' }} direction="column" justifyContent="flex-start" alignItems="center" >
<Grid item xs={12} md={12} >
<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" }}>
<FormattedMessage id="loginErrorMessage6" />
</Typography>
<Button
component="span"
variant="contained"
size="large"
sx={{ m: 4 }}
onClick={() => {
navigate("/login");
}}
><FormattedMessage id="backToLogin" /></Button>

<Button
component="span"
variant="contained"
size="large"
sx={{ m: 4 }}
onClick={() => {
navigate("/register");
}}
><FormattedMessage id="goRegister" /></Button>

</Grid>
</center>
</Grid>
{/*row 2*/}
</Grid >
</Grid>
{/*row 2*/}
</Grid >

);
};


+ 69
- 0
src/pages/iAmSmart/FailCallback_VerifyMail/index.js Parādīt failu

@@ -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 ?
<Grid container sx={{ minHeight: '87vh', mb: 3 }} direction="column" justifyContent="center" alignItems="center">
<Grid item>
<LoadingComponent />
</Grid>
</Grid>
:

<Grid container sx={{ height: '100%', backgroundColor: '#fff' }} direction="column" justifyContent="flex-start" alignItems="center" >
<Grid item xs={12} md={12} >
<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" }}>
<FormattedMessage id="loginErrorMessage3" />
</Typography>
</Grid>
<Grid item xs={12} md={12} >
<Typography variant="h3" sx={{ ml: 8, mt: 4, mr: 8, textAlign: "center" }}>
<FormattedMessage id="sentSecurityCode2" />
</Typography>
</Grid>
<Grid item xs={12} md={12} >
<Button
component="span"
variant="contained"
size="large"
sx={{ m: 4 }}
onClick={() => {
navigate("/login");
}}
><FormattedMessage id="backToLogin" /></Button>
</Grid>

</center>
</Grid>
</Grid>
{/*row 2*/}
</Grid >

);
};

export default Index;

+ 5
- 0
src/routes/LoginRoutes.js Parādīt failu

@@ -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: <IAmSmart_FailCallback/>
},
{
path: 'iamsmart/notverify',
element: <FailCallback_VerifyMail/>
},
{
path: 'iamsmart/authcallback',
element: <IAmSmart_AuthCallback/>


+ 2
- 0
src/translations/en.json Parādīt failu

@@ -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",


+ 2
- 0
src/translations/zh-CN.json Parādīt failu

@@ -83,6 +83,7 @@
"continue": "继续",
"submit": "提交",
"backToLogin": "返回登入页面",
"goRegister": "帐户申请",
"registerSubmitted": "帐户申请已成功提交。",
"registerFail": "申请失败,请稍后尝试",
"iAmSmartNoIdNoMsg": "无效资料,请返回注册页面。",
@@ -123,6 +124,7 @@
"loginErrorMessage3":"帐户尚未验证",
"loginErrorMessage4":"系统连接失败",
"loginErrorMessage5":"用户名或密码错误",
"loginErrorMessage6":"登入失败,请重试",

"newPassword": "新密码",
"setNewPassword": "请输入新密码",


+ 2
- 0
src/translations/zh-HK.json Parādīt failu

@@ -83,6 +83,7 @@
"continue": "繼續",
"submit": "提交",
"backToLogin": "返回登入頁面",
"goRegister": "帳戶申請",
"registerSubmitted": "帳戶申請已成功提交。",
"registerFail": "申請失敗,請稍後嘗試",
"iAmSmartNoIdNoMsg": "無效資料,請返回注冊頁面。",
@@ -123,6 +124,7 @@
"loginErrorMessage3":"帳戶尚未驗證",
"loginErrorMessage4":"系統連接失敗",
"loginErrorMessage5":"用戶名或密碼錯誤",
"loginErrorMessage6":"登入失敗,請重試",

"newPassword": "新密碼",
"setNewPassword": "請輸入新密碼",


Notiek ielāde…
Atcelt
Saglabāt