Pārlūkot izejas kodu

add login error when backend did not start or without connection

master
Alex Cheung pirms 1 gada
vecāks
revīzija
605131c912
5 mainītis faili ar 47 papildinājumiem un 19 dzēšanām
  1. +5
    -1
      src/pages/authentication/auth-forms/AuthLoginCustom.js
  2. +21
    -16
      src/pages/authentication/auth-forms/PasswordAlertDialog.js
  3. +7
    -0
      src/translations/en.json
  4. +7
    -0
      src/translations/zh-CN.json
  5. +7
    -2
      src/translations/zh-HK.json

+ 5
- 1
src/pages/authentication/auth-forms/AuthLoginCustom.js Parādīt failu

@@ -118,7 +118,11 @@ const AuthLoginCustom = () => {
.catch((error) => {
// setSuccess(false)
setOnLogin(false)
setErrorMassage(error.response.data.error)
if(error.response!= undefined){
setErrorMassage(error.response.data.error)
}else{
setErrorMassage("CONNECTION_ERROR")
}
setOpen(true)
});
} else {


+ 21
- 16
src/pages/authentication/auth-forms/PasswordAlertDialog.js Parādīt failu

@@ -29,22 +29,27 @@ const PasswordAlertDialog = (props) => {
<DialogTitle id="alert-dialog-title">
<Stack mt={1} mr={4} direction="row" justifyContent="flex-start" alignItems="center" spacing={2}>
<CancelOutlinedIcon color="error" sx={{ width: "35px", height: "40px" }} />
{props.errorMassage === 'ACCOUNT_LOCKED_ERROR' ?
<Stack direction="column">
<Typography display="inline">
帳戶將被封鎖
</Typography>
<Typography display="inline">
帳戶連續五次登入錯誤,請與系統管理員聯絡
</Typography>
</Stack> :
props.errorMassage === 'ACCOUNT_VERIFIED_ERROR' ?
<Typography display="inline">
帳戶尚未驗證
</Typography> :
<Typography display="inline">
用戶名或密碼錯誤
</Typography>
{
props.errorMassage === 'ACCOUNT_LOCKED_ERROR' ?
<Stack direction="column">
<Typography display="inline">
<FormattedMessage id="loginErrorMessage1"/>
</Typography>
<Typography display="inline">
<FormattedMessage id="loginErrorMessage2"/>
</Typography>
</Stack> :
props.errorMassage === 'ACCOUNT_VERIFIED_ERROR' ?
<Typography display="inline">
<FormattedMessage id="loginErrorMessage3"/>
</Typography> :
props.errorMassage === 'CONNECTION_ERROR' ?
<Typography display="inline">
<FormattedMessage id="loginErrorMessage4"/>
</Typography>:
<Typography display="inline">
<FormattedMessage id="loginErrorMessage5"/>
</Typography>
}
</Stack>
</DialogTitle>


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

@@ -105,6 +105,13 @@
"register": "Register",
"userLoginName": "Username",
"userPassword": "Password",
"loginErrorMessage1":"Account will be blocked",
"loginErrorMessage2":"Account login errors for Five Consecutive Times, please contact the system administrator",
"loginErrorMessage3":"Account has not been Verified",
"loginErrorMessage4":"System Connection Failed",
"loginErrorMessage5":"Incorrect Username or Password",

"newPassword": "New Password",
"setNewPassword": "Please enter new password",
"forgotUserPassword": "Forgot Password",


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

@@ -104,6 +104,13 @@
"register": "申请",
"userLoginName": "用户登入名称",
"userPassword": "密码",
"loginErrorMessage1":"帐户将被封锁",
"loginErrorMessage2":"帐户连续五次登入错误,请与系统管理员联络",
"loginErrorMessage3":"帐户尚未验证",
"loginErrorMessage4":"系统连接失败",
"loginErrorMessage5":"用户名或密码错误",

"newPassword": "新密码",
"setNewPassword": "请输入新密码",
"forgotUserPassword": "忘记密码",


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

@@ -104,6 +104,13 @@
"register": "申請",
"userLoginName": "用戶登入名稱",
"userPassword": "密碼",
"loginErrorMessage1":"帳戶將被封鎖",
"loginErrorMessage2":"帳戶連續五次登入錯誤,請與系統管理員聯絡",
"loginErrorMessage3":"帳戶尚未驗證",
"loginErrorMessage4":"系統連接失敗",
"loginErrorMessage5":"用戶名或密碼錯誤",

"newPassword": "新密碼",
"setNewPassword": "請輸入新密碼",
"forgotUserPassword": "忘記密碼",
@@ -112,10 +119,8 @@
"forgotPasswordSubTitle": "請輸入你的用戶登入名稱以重設密碼",
"forgotPasswordSubTitle1": "請輸入你的用戶登入名稱",
"forgotPasswordSubTitle2": "以重設密碼",

"forgotUsernameSubTitle": "請輸入你的電郵以重設密碼",
"forgotUsernameSubTitle1": "請輸入你的電郵",
"resetPasswordSuccess": "已成功重設密碼。",
"securityCode": "安全驗證碼",
"sentSecurityCode1": "我們已將驗證碼送至你的電郵:",


Notiek ielāde…
Atcelt
Saglabāt