diff --git a/src/layout/MainLayout/Header/HeaderContent/Profile/index.js b/src/layout/MainLayout/Header/HeaderContent/Profile/index.js
index 9f2d6f0..3bbfed0 100644
--- a/src/layout/MainLayout/Header/HeaderContent/Profile/index.js
+++ b/src/layout/MainLayout/Header/HeaderContent/Profile/index.js
@@ -152,9 +152,9 @@ const Profile = () => {
我的帳戶
- {userData == null ? "" : userData.fullName}
+ {userData == null ? "" : userData.fullenName}
- {/* {userData == null ? "" : userData.fullName} */}
+ {/* {userData == null ? "" : userData.fullenName} */}
diff --git a/src/layout/MainLayout/Header/index.js b/src/layout/MainLayout/Header/index.js
index 9e46add..a1a9b63 100644
--- a/src/layout/MainLayout/Header/index.js
+++ b/src/layout/MainLayout/Header/index.js
@@ -41,7 +41,7 @@ import AdminLogo from 'components/AdminLogo';
import MobileLogo from 'components/MobileLogo';
import Profile from './HeaderContent/Profile';
import "assets/style/navbarStyles.css";
-import {isUserLoggedIn,isAdminLoggedIn} from "utils/Utils";
+import {isUserLoggedIn,isGLDLoggedIn} from "utils/Utils";
import { handleLogoutFunction } from 'auth/index';
// assets
@@ -71,7 +71,7 @@ function Header(props) {
};
const loginContent = (
- isAdminLoggedIn() ?
+ isGLDLoggedIn() ?
Dashboard
@@ -180,7 +180,7 @@ function Header(props) {
- {isAdminLoggedIn()
+ {isGLDLoggedIn()
? (
justifyContent="space-between"
alignItems="center"
spacing={2}>
-
+
香港特別行政區政府
憲報
{
setPosts(response.data);
const userData = {
id: response.data.id,
- fullName: response.data.name,
+ fullenName: response.data.name,
+ fullchName: response.data.chName,
email: response.data.email,
+ type: response.data.type,
role: response.data.role,
abilities: response.data.abilities,
//avatar: require('src/assets/images/users/avatar-3.png').default,
diff --git a/src/pages/authentication/auth-forms/AuthLoginCustom.js b/src/pages/authentication/auth-forms/AuthLoginCustom.js
index 15d4288..ae54206 100644
--- a/src/pages/authentication/auth-forms/AuthLoginCustom.js
+++ b/src/pages/authentication/auth-forms/AuthLoginCustom.js
@@ -55,12 +55,8 @@ const AuthLoginCustom = () => {
// let [posts, setPosts] = useState([]);
const [isValid, setisValid] = useState(false);
- // const [isSuccess, setSuccess] = useState();
- // const [isSumitting, setSumitting] = useState();
const [open, setOpen] = React.useState(false);
- // useEffect(() => {
- // // console.log("POST: " + posts.accessToken);
- // },[posts]);
+ const [isButtonDisabled, setIsButtonDisabled] = useState(true);
const handleMouseDownPassword = (event) => {
event.preventDefault();
@@ -72,10 +68,13 @@ const AuthLoginCustom = () => {
useJwt
.login({username: values.username, password: values.password})
.then((response) => {
+ console.log("123")
const userData = {
id: response.data.id,
- fullName: response.data.name,
+ fullenName: response.data.name,
+ fullchName: response.data.chName,
email: response.data.email,
+ type: response.data.type,
role: response.data.role,
abilities: response.data.abilities,
//avatar: require('src/assets/images/users/avatar-3.png').default,
@@ -90,6 +89,7 @@ const AuthLoginCustom = () => {
// setSuccess(false)
setOpen(true)
console.error(error)
+ console.log("321")
});
}else{
setOpen(true)
@@ -121,9 +121,11 @@ const AuthLoginCustom = () => {
)
{
setisValid(true)
+ setIsButtonDisabled(false);
return isValid
}else{
setisValid(false)
+ setIsButtonDisabled(true);
return isValid
}
};
@@ -134,27 +136,22 @@ const AuthLoginCustom = () => {
var lowerCase = /[a-z]/g;
var upperCase = /[A-Z]/g;
var numbers = /[0-9]/g;
+ var symbol = /^(?=.*[!@#%&])/;
if (!new_pass.match(lowerCase)) {
return false;
} else if (!new_pass.match(upperCase)) {
return false;
} else if (!new_pass.match(numbers)) {
return false;
- } else if (new_pass.length < 8) {
+ } else if (!new_pass.match(symbol)) {
return false;
+ } else if (new_pass.length < 8) {
+ return false;
} else {
return true;
}
}
- // function handle6Digi(value) {
- // if (value.length < 6) {
- // return false;
- // } else {
- // return true;
- // }
- // }
-
const handleClose = () => {
setOpen(false);
};
@@ -235,15 +232,23 @@ const AuthLoginCustom = () => {
-
-
+
忘記密碼?
@@ -252,7 +257,7 @@ const AuthLoginCustom = () => {
- }>智方便登入
+ }>智方便登入
@@ -265,14 +270,6 @@ const AuthLoginCustom = () => {
建立/重新啟動帳戶
- {/* */}
- {/* */}
- {/* Login with*/}
- {/* */}
- {/**/}
- {/**/}
- {/* */}
- {/* */}
diff --git a/src/pages/authentication/auth-forms/BusCustomFormWizard.js b/src/pages/authentication/auth-forms/BusCustomFormWizard.js
index bca0437..d5046c6 100644
--- a/src/pages/authentication/auth-forms/BusCustomFormWizard.js
+++ b/src/pages/authentication/auth-forms/BusCustomFormWizard.js
@@ -313,14 +313,17 @@ const BusCustomFormWizard = (props) => {
var lowerCase = /[a-z]/g;
var upperCase = /[A-Z]/g;
var numbers = /[0-9]/g;
+ var symbol = /^(?=.*[!@#%&])/;
if (!new_pass.match(lowerCase)) {
return false;
} else if (!new_pass.match(upperCase)) {
return false;
} else if (!new_pass.match(numbers)) {
return false;
- } else if (new_pass.length < 8) {
+ } else if (!new_pass.match(symbol)) {
return false;
+ } else if (new_pass.length < 8) {
+ return false;
} else {
return true;
}
diff --git a/src/pages/authentication/auth-forms/CustomFormWizard.js b/src/pages/authentication/auth-forms/CustomFormWizard.js
index e44c7f4..e66b921 100644
--- a/src/pages/authentication/auth-forms/CustomFormWizard.js
+++ b/src/pages/authentication/auth-forms/CustomFormWizard.js
@@ -334,12 +334,15 @@ const CustomFormWizard = (props) => {
var lowerCase = /[a-z]/g;
var upperCase = /[A-Z]/g;
var numbers = /[0-9]/g;
+ var symbol = /^(?=.*[!@#%&])/;
if (!new_pass.match(lowerCase)) {
return false;
} else if (!new_pass.match(upperCase)) {
return false;
} else if (!new_pass.match(numbers)) {
return false;
+ } else if (!new_pass.match(symbol)) {
+ return false;
} else if (new_pass.length < 8) {
return false;
} else {
@@ -849,6 +852,7 @@ const CustomFormWizard = (props) => {
options={address5ComboList}
onChange={(event, newValue) => {
setSelectedAddress5(newValue);
+ // if()
}}
sx={{"& .MuiInputBase-root": { height: "41px" },"#address5-combo":{padding: "0px 0px 0px 0px"}, "& .MuiAutocomplete-endAdornment": { top: "auto" },}}
@@ -1085,7 +1089,7 @@ const CustomFormWizard = (props) => {
身份證明文件
請上傳你的 有效身份證明文件 的數碼檔案,以驗證你的身份。
- 如: 香港身份證; 護照; 中國內地身份證等
+ 如: 香港身份證; 護照; 中國內地身份證; 專業執業証書等
上傳身份證明文件
{
+ const userData = JSON.parse(localStorage.getItem("userData"));
+
+ return (
+
+
+ Moring, {userData.fullenName}
+
+
+
+ );
+};
+
+export default DashboardDefault;
diff --git a/src/pages/pnspsUserDetailPage/UserInformationCard.js b/src/pages/pnspsUserDetailPage/UserInformationCard.js
index 002ca9f..1c88171 100644
--- a/src/pages/pnspsUserDetailPage/UserInformationCard.js
+++ b/src/pages/pnspsUserDetailPage/UserInformationCard.js
@@ -171,11 +171,11 @@ const UserInformationCard = ({isCollectData, updateUserObject,userData}) => {
diff --git a/src/pages/pnspsUserSearchPage/UserSearchForm.js b/src/pages/pnspsUserSearchPage/UserSearchForm.js
index 474996d..dc4078b 100644
--- a/src/pages/pnspsUserSearchPage/UserSearchForm.js
+++ b/src/pages/pnspsUserSearchPage/UserSearchForm.js
@@ -53,7 +53,7 @@ const UserSearchForm = ({applySearch}) => {
const temp = {
username: data.userName,
- fullName: data.fullName,
+ fullenName: data.fullenName,
post: data.post,
// subDivision: subDivision,
email: data.email,
@@ -107,8 +107,8 @@ const UserSearchForm = ({applySearch}) => {
diff --git a/src/pages/pnspsUserSearchPage_Individual/UserSearchForm_Individual.js b/src/pages/pnspsUserSearchPage_Individual/UserSearchForm_Individual.js
index 07c5876..2a7ab02 100644
--- a/src/pages/pnspsUserSearchPage_Individual/UserSearchForm_Individual.js
+++ b/src/pages/pnspsUserSearchPage_Individual/UserSearchForm_Individual.js
@@ -28,7 +28,7 @@ const UserSearchForm_Individual = ({applySearch}) => {
const temp = {
username: data.userName,
- fullName: data.fullName,
+ fullenName: data.fullenName,
email: data.email,
phone: data.phone,
accountFilter: accountFilter,
@@ -68,8 +68,8 @@ const UserSearchForm_Individual = ({applySearch}) => {
diff --git a/src/pages/pnspsUserSearchPage_Organization/UserSearchForm_Organization.js b/src/pages/pnspsUserSearchPage_Organization/UserSearchForm_Organization.js
index a17e3e6..833a37a 100644
--- a/src/pages/pnspsUserSearchPage_Organization/UserSearchForm_Organization.js
+++ b/src/pages/pnspsUserSearchPage_Organization/UserSearchForm_Organization.js
@@ -29,7 +29,7 @@ const UserSearchForm_Organization = ({applySearch}) => {
const temp = {
username: data.userName,
- fullName: data.fullName,
+ fullenName: data.fullenName,
email: data.email,
phone: data.phone,
brNoStr: data.brNoStr,
@@ -90,8 +90,8 @@ const UserSearchForm_Organization = ({applySearch}) => {
diff --git a/src/pages/publicDashboard/index.js b/src/pages/publicDashboard/index.js
new file mode 100644
index 0000000..a887f3f
--- /dev/null
+++ b/src/pages/publicDashboard/index.js
@@ -0,0 +1,40 @@
+// import { useState } from 'react';
+
+// material-ui
+import {
+ // Avatar,
+ // AvatarGroup,
+ // Box,
+ // Button,
+ Grid,
+ // List,
+ // ListItemAvatar,
+ // ListItemButton,
+ // ListItemSecondaryAction,
+ // ListItemText,
+ // MenuItem,
+ // Stack,
+ // TextField,
+ Typography
+} from '@mui/material';
+
+// project import
+// import Loadable from 'components/Loadable';
+// import { lazy } from 'react';
+
+
+// ==============================|| DASHBOARD - DEFAULT ||============================== //
+
+const DashboardDefault = () => {
+
+ return (
+
+
+ 我的公共啟事
+
+
+
+ );
+};
+
+export default DashboardDefault;
diff --git a/src/routes/GLDUserRoutes.js b/src/routes/GLDUserRoutes.js
new file mode 100644
index 0000000..631ced1
--- /dev/null
+++ b/src/routes/GLDUserRoutes.js
@@ -0,0 +1,32 @@
+import { lazy } from 'react';
+
+// project import
+import Loadable from 'components/Loadable';
+import MainLayout from 'layout/MainLayout';
+
+// render - dashboard
+const DashboardDefault = Loadable(lazy(() => import('pages/gldDashboard')));
+
+// ==============================|| MAIN ROUTING ||============================== //
+
+const GLDUserRoutes = {
+ path: '/',
+ element: ,
+ children: [
+ {
+ path: '/',
+ element:
+ },
+ {
+ path: '/',
+ children: [
+ {
+ path: 'dashboard',
+ element:
+ }
+ ]
+ },
+ ]
+};
+
+export default GLDUserRoutes;
diff --git a/src/routes/MainRoutes.js b/src/routes/MainRoutes.js
index 7bf56d2..22135a0 100644
--- a/src/routes/MainRoutes.js
+++ b/src/routes/MainRoutes.js
@@ -5,7 +5,6 @@ import Loadable from 'components/Loadable';
import MainLayout from 'layout/MainLayout';
// render - dashboard
-const DashboardDefault = Loadable(lazy(() => import('pages/dashboard')));
// render - sample page
const SamplePage = Loadable(lazy(() => import('pages/extra-pages/SamplePage')));
@@ -22,19 +21,6 @@ const MainRoutes = {
path: '/',
element: ,
children: [
- {
- path: '/',
- element:
- },
- {
- path: '/',
- children: [
- {
- path: 'dashboard',
- element:
- }
- ]
- },
{
path: 'color',
element:
diff --git a/src/routes/PublicUserRoutes.js b/src/routes/PublicUserRoutes.js
new file mode 100644
index 0000000..1f15fb9
--- /dev/null
+++ b/src/routes/PublicUserRoutes.js
@@ -0,0 +1,32 @@
+import { lazy } from 'react';
+
+// project import
+import Loadable from 'components/Loadable';
+import MainLayout from 'layout/MainLayout';
+
+// render - dashboard
+const DashboardDefault = Loadable(lazy(() => import('pages/publicDashboard')));
+
+// ==============================|| MAIN ROUTING ||============================== //
+
+const PublicDashboard = {
+ path: '/',
+ element: ,
+ children: [
+ {
+ path: '/',
+ element:
+ },
+ {
+ path: '/',
+ children: [
+ {
+ path: 'dashboard',
+ element:
+ }
+ ]
+ },
+ ]
+};
+
+export default PublicDashboard;
diff --git a/src/routes/index.js b/src/routes/index.js
index ea061dc..58d3dbc 100644
--- a/src/routes/index.js
+++ b/src/routes/index.js
@@ -1,8 +1,15 @@
// project import
import LoginRoutes from './LoginRoutes'
import MainRoutes from './MainRoutes'
+import PublicUserRoutes from './PublicUserRoutes'
+import GLDUserRoutes from './GLDUserRoutes'
import {useRoutes} from 'react-router-dom'
-import {isUserLoggedIn,isAdminLoggedIn} from "utils/Utils";
+import {isUserLoggedIn,
+ // isAdminLoggedIn,
+ isGLDLoggedIn,
+ isINDLoggedIn,
+ isORGLoggedIn,
+ } from "utils/Utils";
import {Navigate} from "react-router";
import {
setupAxiosInterceptors,
@@ -36,7 +43,9 @@ console.log();
]
},
isUserLoggedIn() ? MainRoutes : LoginRoutes,
- isUserLoggedIn()&&isAdminLoggedIn() ? SettingRoutes : LoginRoutes,
+ isUserLoggedIn()&&isINDLoggedIn()||isUserLoggedIn()&&isORGLoggedIn() ? PublicUserRoutes : LoginRoutes,
+ isUserLoggedIn()&&isGLDLoggedIn() ? SettingRoutes : LoginRoutes,
+ isUserLoggedIn()&&isGLDLoggedIn() ? GLDUserRoutes : LoginRoutes,
!isUserLoggedIn()?{
path: '*',
element:
diff --git a/src/utils/Utils.js b/src/utils/Utils.js
index 9d648ca..8436791 100644
--- a/src/utils/Utils.js
+++ b/src/utils/Utils.js
@@ -62,7 +62,22 @@ export const isAdminLoggedIn = () =>{
if (localStorage.getItem('userData') != null){
return JSON.parse(localStorage.getItem('userData')).role === 'admin'
}
-}
+}
+export const isGLDLoggedIn = () =>{
+ if (localStorage.getItem('userData') != null){
+ return JSON.parse(localStorage.getItem('userData')).type === 'GLD'
+ }
+}
+export const isINDLoggedIn = () =>{
+ if (localStorage.getItem('userData') != null){
+ return JSON.parse(localStorage.getItem('userData')).type === 'IND'
+ }
+}
+export const isORGLoggedIn = () =>{
+ if (localStorage.getItem('userData') != null){
+ return JSON.parse(localStorage.getItem('userData')).type === 'ORG'
+ }
+}
/**
** This function is used for demo purpose route navigation
** In real app you won't need this function because your app will navigate to same route for each users regardless of ability