瀏覽代碼

update send email with forgot password and layout fix

master
Alex Cheung 1 年之前
父節點
當前提交
21f153d063
共有 14 個文件被更改,包括 46 次插入48 次删除
  1. +1
    -0
      src/components/I18nProvider.js
  2. +6
    -2
      src/components/RefreshTokenProvider.js
  3. +1
    -1
      src/layout/MainLayout/Header/HeaderContent/LocaleSelector.js
  4. +1
    -1
      src/pages/DemandNote/Search/index.js
  5. +1
    -1
      src/pages/Organization/SearchPage/index.js
  6. +1
    -1
      src/pages/Proof/Search_GLD/index.js
  7. +1
    -1
      src/pages/PublicNotice/ListPanel/index.js
  8. +1
    -1
      src/pages/PublicNotice/Search_GLD/index.js
  9. +1
    -1
      src/pages/User/DetailsPage_Organization/index.js
  10. +1
    -1
      src/pages/User/SearchPage_Organization/index.js
  11. +19
    -28
      src/pages/authentication/ForgotPassword/ForgotPasswordApplyForm.js
  12. +8
    -7
      src/pages/authentication/auth-forms/AuthLoginCustom.js
  13. +3
    -3
      src/pages/iAmSmart/AuthCallback/index.js
  14. +1
    -0
      src/utils/ApiPathConst.js

+ 1
- 0
src/components/I18nProvider.js 查看文件

@@ -26,6 +26,7 @@ export const I18nProvider = ({ children }) => {
setLocale(localStorage.getItem('locale'));
}
}, []);
useEffect(() => {
// Load the messages for the selected locale
const fetchMessages = async () => {


+ 6
- 2
src/components/RefreshTokenProvider.js 查看文件

@@ -2,7 +2,9 @@ import { createContext, useEffect, useRef, useCallback } from 'react';
import { apiPath } from 'auth/utils';
import { REFRESH_TOKEN } from 'utils/ApiPathConst';
import axios from 'axios';

import {
isUserLoggedIn,
} from "utils/Utils";
const RefreshTokenContext = createContext();

const RefreshTokenProvider = ({ children }) => {
@@ -55,7 +57,9 @@ const RefreshTokenProvider = ({ children }) => {
// console.log('accessToken: ' + localStorage.getItem('accessToken'));
// console.log('refreshToken: ' + localStorage.getItem('refreshToken'));
if (currentTime >= expiryTime) {
handleRefreshToken();
if(isUserLoggedIn()){
handleRefreshToken();
}
}
}
}, [token]);


+ 1
- 1
src/layout/MainLayout/Header/HeaderContent/LocaleSelector.js 查看文件

@@ -18,7 +18,7 @@ import Transitions from 'components/@extended/Transitions';
import LanguageIcon from '@mui/icons-material/Language';
import {FormattedMessage} from "react-intl";
import * as React from "react";
import LocaleContext from "../../../../components/I18nProvider";
import LocaleContext from "components/I18nProvider";

// ==============================|| HEADER CONTENT - NOTIFICATION ||============================== //



+ 1
- 1
src/pages/DemandNote/Search/index.js 查看文件

@@ -98,7 +98,7 @@ const UserSearchPage_Individual = () => {
</Grid>
</Grid>
:
<Grid container sx={{ backgroundColor: 'backgroundColor.default' }} direction="column">
<Grid container sx={{ minHeight: '95vh', backgroundColor: 'backgroundColor.default' }} direction="column">
<Grid item xs={12}>
<div style={BackgroundHead}>
<Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center">


+ 1
- 1
src/pages/Organization/SearchPage/index.js 查看文件

@@ -71,7 +71,7 @@ const OrganizationSearchPage = () => {
</Grid>
</Grid>
:
<Grid container sx={{backgroundColor:"backgroundColor.default"}}>
<Grid container sx={{minHeight: '95vh', backgroundColor:"backgroundColor.default"}} direction="column">
<Grid item xs={12}>
<div style={BackgroundHead}>
<Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center">


+ 1
- 1
src/pages/Proof/Search_GLD/index.js 查看文件

@@ -96,7 +96,7 @@ const UserSearchPage_Individual = () => {
</Grid>
</Grid>
:
<Grid container sx={{ backgroundColor: 'backgroundColor.default' }} direction="column"
<Grid container sx={{ minHeight: '95vh', backgroundColor: 'backgroundColor.default' }} direction="column"
>
<Grid item xs={12}>
<div style={BackgroundHead}>


+ 1
- 1
src/pages/PublicNotice/ListPanel/index.js 查看文件

@@ -108,7 +108,7 @@ const PublicNotice = () => {
</Grid>
</Grid>
:
<Grid container>
<Grid container sx={{ minHeight: '95vh', backgroundColor:'backgroundColor.default'}} direction="column">
<Grid item xs={12}>
<div style={BackgroundHead}>
<Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center">


+ 1
- 1
src/pages/PublicNotice/Search_GLD/index.js 查看文件

@@ -96,7 +96,7 @@ const UserSearchPage_Individual = () => {
</Grid>
</Grid>
:
<Grid container sx={{ backgroundColor: 'backgroundColor.default' }}>
<Grid container sx={{ minHeight: '95vh',backgroundColor: 'backgroundColor.default' }} direction="column">
<Grid item xs={12}>
<div style={BackgroundHead}>
<Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center">


+ 1
- 1
src/pages/User/DetailsPage_Organization/index.js 查看文件

@@ -185,7 +185,7 @@ const UserMaintainPage_Organization = () => {
</Grid>
</Grid>
:
<Grid container sx={{ backgroundColor: isGLDLoggedIn()?'backgroundColor.default':'#ffffff' }}>
<Grid container sx={{ minHeight: '95vh', backgroundColor: isGLDLoggedIn()?'backgroundColor.default':'#ffffff' }} direction="column">
<Grid item xs={12}>
<div style={BackgroundHead}>
<Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center">


+ 1
- 1
src/pages/User/SearchPage_Organization/index.js 查看文件

@@ -72,7 +72,7 @@ const UserSearchPage_Organization = () => {
</Grid>
</Grid>
:
<Grid container sx={{backgroundColor:"backgroundColor.default"}}>
<Grid container sx={{minHeight: '95vh',backgroundColor:"backgroundColor.default"}} direction="column">
<Grid item xs={12}>
<div style={BackgroundHead}>
<Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center">


+ 19
- 28
src/pages/authentication/ForgotPassword/ForgotPasswordApplyForm.js 查看文件

@@ -15,8 +15,8 @@ import {
import { useFormik } from 'formik';
import * as yup from 'yup';
import * as React from "react";
// import * as HttpUtils from "utils/HttpUtils";
// import * as UrlUtils from "utils/ApiPathConst";
import * as HttpUtils from "utils/HttpUtils";
import * as UrlUtils from "utils/ApiPathConst";
// import * as FieldUtils from "utils/FieldUtils";
import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png'
import ForwardIcon from '@mui/icons-material/Forward';
@@ -60,32 +60,23 @@ const ForgotPasswordApplyForm = () => {
}),
onSubmit: values => {
console.log(values)
navigate('/forgot/password/sent');
// HttpUtils.postWithFiles({
// url: UrlUtils.POST_PUBLIC_NOTICE_APPLY,
// params: {
// id: 0,
// contactPerson: values.contactPerson,
// contactTelNo: {
// countryCode: values.tel_countryCode,
// phoneNumber: values.phoneNumber
// },
// contactFaxNo: {
// countryCode: values.fax_countryCode,
// faxNumber: values.faxNumber
// },
// issueId: issueId,
// careOf: values.careOf ? values.careOf: "",
// remarks: values.remarks ? values.remarks : "",
// },
// // files: [attachment],
// onSuccess: function () {
// notifyActionSuccess(intl.formatMessage({id: 'submissionSuccess'}) + '!')
// navigate("/publicNotice");
// // location.reload();
// }
// });
HttpUtils.post({
url: UrlUtils.POST_FORGOT_PASSWORD_EMAIL,
params: {
username: values.username,
},
// files: [attachment],
onSuccess: function () {
// notifyActionSuccess(intl.formatMessage({id: 'submissionSuccess'}) + '!')
navigate('/forgot/password/sent');
console.log("jjj")
// location.reload();
},
onError:function () {
navigate('/forgot/password/sent');
console.log("hihihi")
}
});
}
});



+ 8
- 7
src/pages/authentication/auth-forms/AuthLoginCustom.js 查看文件

@@ -1,7 +1,8 @@
import React, {
useEffect,
useState,
lazy, useContext
lazy,
// useContext
} from 'react';
import { Link as RouterLink } from 'react-router-dom';
import { useNavigate } from 'react-router-dom';
@@ -42,17 +43,17 @@ import { EyeOutlined, EyeInvisibleOutlined } from '@ant-design/icons';
import iAmSmartICon from 'assets/images/icons/icon_iAmSmart.png';
import { useDispatch } from "react-redux";
import { handleLogin } from "auth/index";
import useJwt from "../../../auth/jwt/useJwt";
import useJwt from "auth/jwt/useJwt";
import { handleLogoutFunction } from 'auth/index';
import {FormattedMessage, useIntl} from "react-intl";
import LocaleContext from "../../../components/I18nProvider";
// import LocaleContext from "components/I18nProvider";
// ============================|| FIREBASE - LOGIN ||============================ //

const AuthLoginCustom = () => {
const dispatch = useDispatch()
const navigate = useNavigate()
const intl = useIntl();
const { setLocale } = useContext(LocaleContext);
// const { setLocaleFromLogin } = useContext(LocaleContext);

const [showPassword, setShowPassword] = useState(false);
const handleClickShowPassword = () => {
@@ -93,15 +94,15 @@ const AuthLoginCustom = () => {
// setSuccess(true)
// console.log(response.data);
if(response.data.type === "GLD"){
setLocale("en");
// setLocale("en");
localStorage.setItem('locale','en');
}else{
if (response.data.preferLocale ==="zh_HK"){
setLocale("zh-HK");
// setLocale("zh-HK");
localStorage.setItem('locale','zh-HK');
}
if (response.data.preferLocale ==="zh-CN"){
setLocale("zh-CN");
// setLocale("zh-CN");
localStorage.setItem('locale','zh-CN');
}
}


+ 3
- 3
src/pages/iAmSmart/AuthCallback/index.js 查看文件

@@ -50,15 +50,15 @@ const Index = () => {
}
const data = { ...userData, accessToken: responseData.accessToken, refreshToken: responseData.refreshToken }
if(responseData.type === "GLD"){
setLocale("en");
// setLocale("en");
localStorage.setItem('locale','en');
}else{
if (responseData.preferLocale ==="zh_HK"){
setLocale("zh-HK");
// setLocale("zh-HK");
localStorage.setItem('locale','zh-HK');
}
if (responseData.preferLocale ==="zh-CN"){
setLocale("zh-CN");
// setLocale("zh-CN");
localStorage.setItem('locale','zh-CN');
}
}


+ 1
- 0
src/utils/ApiPathConst.js 查看文件

@@ -75,6 +75,7 @@ export const GET_ID = apiPath+'/user/verifyID';
export const GET_VERIFY_USER_ACCOUNT = apiPath+'/user/verifyEmail';
export const GET_FORGOT_PASSWORD_VERIFY_USER_ACCOUNT = apiPath+'/user/verifyForgotPasswordEmail';
export const POST_FORGOT_PASSWORD_NEW_PASSWORD = apiPath+'/user/forgotPasswordNewPassword';
export const POST_FORGOT_PASSWORD_EMAIL = apiPath+'/user/sendForgotPasswordEmail';


//Public


Loading…
取消
儲存