diff --git a/src/layout/MainLayout/Header/index.js b/src/layout/MainLayout/Header/index.js index 264f8c5..87b385c 100644 --- a/src/layout/MainLayout/Header/index.js +++ b/src/layout/MainLayout/Header/index.js @@ -73,7 +73,10 @@ function Header(props) { User
  • - Public User + Individual User +
  • +
  • + Organization User
  • User Group diff --git a/src/pages/pnspsUserDetailPage_Public/UserInformationCard_Public.js b/src/pages/pnspsUserDetailPage_Individual/UserInformationCard_Individual.js similarity index 98% rename from src/pages/pnspsUserDetailPage_Public/UserInformationCard_Public.js rename to src/pages/pnspsUserDetailPage_Individual/UserInformationCard_Individual.js index 4e9fa37..18f739a 100644 --- a/src/pages/pnspsUserDetailPage_Public/UserInformationCard_Public.js +++ b/src/pages/pnspsUserDetailPage_Individual/UserInformationCard_Individual.js @@ -18,7 +18,7 @@ import * as UrlUtils from "../../utils/ApiPathConst"; // ==============================|| DASHBOARD - DEFAULT ||============================== // -const UserInformationCard_Public = ({userData, loadDataFun}) => { +const UserInformationCard_Individual = ({userData, loadDataFun}) => { const [currentUserData, setCurrentUserData] = useState(userData); const [editMode, setEditMode] = useState(false); @@ -90,7 +90,7 @@ const UserInformationCard_Public = ({userData, loadDataFun}) => { // }); HttpUtils.post({ - url: UrlUtils.POST_PUBLIC_USER+"/"+userData.id, + url: UrlUtils.POST_IND_USER+"/"+userData.id, params: { prefix: _formData.prefix, enName: _formData.enName, @@ -125,7 +125,7 @@ const UserInformationCard_Public = ({userData, loadDataFun}) => { const doLock = () => { HttpUtils.get({ - url: UrlUtils.GET_PUBLIC_USER_LOCK+"/"+userData.id, + url: UrlUtils.GET_USER_LOCK+"/"+userData.id, onSuccess: function(){ loadDataFun(); } @@ -134,7 +134,7 @@ const UserInformationCard_Public = ({userData, loadDataFun}) => { const doUnlock = () => { HttpUtils.get({ - url: UrlUtils.GET_PUBLIC_USER_UNLOCK+"/"+userData.id, + url: UrlUtils.GET_USER_UNLOCK+"/"+userData.id, onSuccess: function(){ loadDataFun(); } @@ -644,4 +644,4 @@ const UserInformationCard_Public = ({userData, loadDataFun}) => { ); }; -export default UserInformationCard_Public; +export default UserInformationCard_Individual; diff --git a/src/pages/pnspsUserDetailPage_Public/index.js b/src/pages/pnspsUserDetailPage_Individual/index.js similarity index 78% rename from src/pages/pnspsUserDetailPage_Public/index.js rename to src/pages/pnspsUserDetailPage_Individual/index.js index 931f3d1..923ea70 100644 --- a/src/pages/pnspsUserDetailPage_Public/index.js +++ b/src/pages/pnspsUserDetailPage_Individual/index.js @@ -6,14 +6,14 @@ import * as React from "react"; import * as HttpUtils from "../../utils/HttpUtils"; import {apiPath} from "../../auth/utils"; import {useParams} from "react-router-dom"; -import UserInformationCard from "./UserInformationCard_Public"; +import UserInformationCard from "./UserInformationCard_Individual"; import LoadingComponent from "../extra-pages/LoadingComponent"; import * as UrlUtils from "../../utils/ApiPathConst"; // ==============================|| DASHBOARD - DEFAULT ||============================== // -const UserMaintainPage_Public = () => { +const UserMaintainPage_Individual = () => { const params = useParams(); const [userData, setUserData] = useState({}) const [isLoading, setLoding] = useState(true); @@ -26,14 +26,12 @@ const UserMaintainPage_Public = () => { const loadData = ()=>{ setLoding(true); - HttpUtils.get( - { - url: `${apiPath}${UrlUtils.GET_USER_PATH}/${params.id}`, - onSuccess: function(response){ - setUserData(response.data) - } + HttpUtils.get({ + url: `${apiPath}${UrlUtils.GET_USER_PATH}/${params.id}`, + onSuccess: function(response){ + setUserData(response.data) } - ); + }); }; @@ -47,7 +45,7 @@ const UserMaintainPage_Public = () => { : - Public User + Individual User {/*col 1*/} @@ -67,4 +65,4 @@ const UserMaintainPage_Public = () => { }; -export default UserMaintainPage_Public; +export default UserMaintainPage_Individual; diff --git a/src/pages/pnspsUserDetailPage_Organization/UserInformationCard_Organization.js b/src/pages/pnspsUserDetailPage_Organization/UserInformationCard_Organization.js new file mode 100644 index 0000000..7f98ede --- /dev/null +++ b/src/pages/pnspsUserDetailPage_Organization/UserInformationCard_Organization.js @@ -0,0 +1,445 @@ +// material-ui +import { + Grid, TextField, Typography, Button +} from '@mui/material'; +import MainCard from "../../components/MainCard"; +import * as React from "react"; +import {useForm} from "react-hook-form"; +import {useEffect, useState} from "react"; +import * as DateUtils from '../../utils/DateUtils'; +import * as HttpUtils from '../../utils/HttpUtils'; +import * as UrlUtils from "../../utils/ApiPathConst"; + +// ==============================|| DASHBOARD - DEFAULT ||============================== // + + +const UserInformationCard_Organization = ({userData, loadDataFun}) => { + + const [currentUserData, setCurrentUserData] = useState(userData); + const [editMode, setEditMode] = useState(false); + const [locked, setLocked] = useState(false); + + + const from = useForm({defaultValues: userData}); + const {register,reset, handleSubmit} = from; + + useEffect(() => { + let createDate = DateUtils.datetimeStr(userData.created); + let modifiedBy = DateUtils.datetimeStr(userData.modified)+", "+userData.modifiedBy; + userData["createDate"] = createDate; + userData["modifieDate"] = modifiedBy; + userData["verifiedStatus"] = userData.verified? "Not verify yet":"Verified"; + + userData["country"] = userData.address?.country; + userData["addressLine1"] = userData.address?.addressLine1; + userData["addressLine2"] = userData.address?.addressLine2; + userData["addressLine3"] = userData.address?.addressLine3; + userData["addressLine3"] = userData.address?.addressLine3; + + userData["phoneNumber"] = userData.contactTel?.phoneNumber; + userData["tel_countryCode"] = userData.contactTel?.countryCode; + + userData["faxNumber"] = userData.faxNo?.faxNumber; + userData["fax_countryCode"] = userData.faxNo?.countryCode; + + setCurrentUserData(userData); + }, [userData]); + + useEffect(() => { + reset(currentUserData); + setLocked(currentUserData.locked); + }, [currentUserData]); + + + function onSubmitForm(_formData) { + HttpUtils.post({ + url: UrlUtils.POST_IND_USER+"/"+userData.id, + params: { + name: _formData.name, + prefix: _formData.prefix, + contactTel: { + countryCode: _formData.tel_countryCode, + phoneNumber: _formData.phoneNumber + }, + identification: _formData.identification, + emailAddress:_formData.emailAddress, + }, + onSuccess: function(){ + loadDataFun(); + } + }); + } + + const onEditClick = () => { + setEditMode(true); + }; + + const doLock = () => { + HttpUtils.get({ + url: UrlUtils.GET_USER_LOCK+"/"+userData.id, + onSuccess: function(){ + loadDataFun(); + } + }); + }; + + const doUnlock = () => { + HttpUtils.get({ + url: UrlUtils.GET_USER_UNLOCK+"/"+userData.id, + onSuccess: function(){ + loadDataFun(); + } + }); + }; + + return ( + + + Information + + +
    + + + + + + Username: + + + + + + + + + + + + Name: + + + + + + + + + + + + Created Date: + + + + + + + + + + + + Prefix: + + + + + + + + + + + + Contact Tel: + + + + + + + + + + + + + + Last Updated: + + + + + + + + + + + + Organization: + + + + + {/* */} + + + + + + + + Verified: + + + { + currentUserData.verified || editMode? + + + + : + <> + + + + + + + + } + + + + + + + + + Email: + + + + + + + + + + + + + Last Login: + + + + + + + + + + + + + + + + Status: + + + + + + + + + + + {/*bottom button*/} + + + + {editMode? + <> + + + + + + + + : + <> + {locked? + + + + : + + + + } + + + + + } + + + + + +
    +
    + ); +}; + +export default UserInformationCard_Organization; diff --git a/src/pages/pnspsUserDetailPage_Organization/UserInformationOrgCard_Organization.js b/src/pages/pnspsUserDetailPage_Organization/UserInformationOrgCard_Organization.js new file mode 100644 index 0000000..865f52d --- /dev/null +++ b/src/pages/pnspsUserDetailPage_Organization/UserInformationOrgCard_Organization.js @@ -0,0 +1,294 @@ +// material-ui +import { + Grid, TextField, Typography, Button +} from '@mui/material'; +import MainCard from "../../components/MainCard"; +import * as React from "react"; +import {useForm} from "react-hook-form"; +import {useEffect, useState} from "react"; +import * as DateUtils from '../../utils/DateUtils'; +import * as HttpUtils from '../../utils/HttpUtils'; +import * as UrlUtils from "../../utils/ApiPathConst"; + +// ==============================|| DASHBOARD - DEFAULT ||============================== // + + +const UserInformationOgCard_Organization = ({userData, loadDataFun}) => { + + const [currentUserData, setCurrentUserData] = useState(userData); + const [editMode, setEditMode] = useState(false); + + + const from = useForm({defaultValues: userData}); + const {register,reset, handleSubmit} = from; + + useEffect(() => { + let createDate = DateUtils.datetimeStr(userData.created); + let modifiedBy = DateUtils.datetimeStr(userData.modified)+", "+userData.modifiedBy; + userData["createDate"] = createDate; + userData["modifieDate"] = modifiedBy; + userData["verifiedStatus"] = userData.verified? "Not verify yet":"Verified"; + + userData["country"] = userData.address?.country; + userData["addressLine1"] = userData.address?.addressLine1; + userData["addressLine2"] = userData.address?.addressLine2; + userData["addressLine3"] = userData.address?.addressLine3; + userData["addressLine3"] = userData.address?.addressLine3; + + userData["phoneNumber"] = userData.contactTel?.phoneNumber; + userData["tel_countryCode"] = userData.contactTel?.countryCode; + + userData["faxNumber"] = userData.faxNo?.faxNumber; + userData["fax_countryCode"] = userData.faxNo?.countryCode; + + setCurrentUserData(userData); + setEditMode(false); + }, [userData]); + + useEffect(() => { + reset(currentUserData); + }, [currentUserData]); + + + function onSubmitForm(_formData) { + HttpUtils.post({ + url: UrlUtils.POST_IND_USER+"/"+userData.id, + params: { + name: _formData.name, + prefix: _formData.prefix, + contactTel: { + countryCode: _formData.tel_countryCode, + phoneNumber: _formData.phoneNumber + }, + identification: _formData.identification, + emailAddress:_formData.emailAddress, + }, + onSuccess: function(){ + loadDataFun(); + } + }); + } + + + return ( + + + Organization + + +
    + + + + + + + Org.Name (English): + + + + + + + + + + + + Org.Name (Chinese): + + + + + + + + + + + + BR No.: + + + + + + + + + + + + + Fax No.: + + + + + + + + + + + + + + Contact Tel: + + + + + + + + + + + + + + + + Email: + + + + + + + + + + + + + BR Expiry Date.: + + + + + + + + + + + + {/*bottom button*/} + + + + {editMode? + <> + + + + + + + + : + + + + + + } + + + + + +
    +
    + ); +}; + +export default UserInformationOgCard_Organization; diff --git a/src/pages/pnspsUserDetailPage_Organization/index.js b/src/pages/pnspsUserDetailPage_Organization/index.js new file mode 100644 index 0000000..21370a4 --- /dev/null +++ b/src/pages/pnspsUserDetailPage_Organization/index.js @@ -0,0 +1,73 @@ +// material-ui +import {Grid, Typography} from '@mui/material'; +import {useEffect, useState} from "react"; +import * as React from "react"; +//import axios from "axios"; +import * as HttpUtils from "../../utils/HttpUtils"; +import {apiPath} from "../../auth/utils"; +import {useParams} from "react-router-dom"; +import UserInformationCard from "./UserInformationCard_Organization"; +import OrgCard from "./UserInformationOrgCard_Organization"; +import LoadingComponent from "../extra-pages/LoadingComponent"; +import * as UrlUtils from "../../utils/ApiPathConst"; + +// ==============================|| DASHBOARD - DEFAULT ||============================== // + + +const UserMaintainPage_Organization = () => { + const params = useParams(); + const [userData, setUserData] = useState({}) + const [isLoading, setLoding] = useState(true); + + + useEffect(()=>{ + console.log(userData); + loadData(); + },[]); + + const loadData = ()=>{ + setLoding(true); + HttpUtils.get({ + url: `${apiPath}${UrlUtils.GET_USER_PATH}/${params.id}`, + onSuccess: function(response){ + setUserData(response.data) + } + }); + }; + + + useEffect(() => { + setLoding(false); + }, [userData]); + + return ( + isLoading ? + + : + + + Organization User + + {/*col 1*/} + + + + + + + + + + {/*col 2*/} + + ); +}; + + +export default UserMaintainPage_Organization; diff --git a/src/pages/pnspsUserSearchPage_Public/UserSearchForm_Public.js b/src/pages/pnspsUserSearchPage_Individual/UserSearchForm_Individual.js similarity index 98% rename from src/pages/pnspsUserSearchPage_Public/UserSearchForm_Public.js rename to src/pages/pnspsUserSearchPage_Individual/UserSearchForm_Individual.js index b448c2f..ca0d9ff 100644 --- a/src/pages/pnspsUserSearchPage_Public/UserSearchForm_Public.js +++ b/src/pages/pnspsUserSearchPage_Individual/UserSearchForm_Individual.js @@ -14,7 +14,7 @@ import * as React from "react"; // ==============================|| DASHBOARD - DEFAULT ||============================== // -const UserSearchForm_Public = ({applySearch}) => { +const UserSearchForm_Individual = ({applySearch}) => { const [type, setType] = useState([]); const [locked, setLocked] = useState(false); @@ -156,4 +156,4 @@ const UserSearchForm_Public = ({applySearch}) => { ); }; -export default UserSearchForm_Public; +export default UserSearchForm_Individual; diff --git a/src/pages/pnspsUserSearchPage_Public/UserTable_Public.js b/src/pages/pnspsUserSearchPage_Individual/UserTable_Individual.js similarity index 96% rename from src/pages/pnspsUserSearchPage_Public/UserTable_Public.js rename to src/pages/pnspsUserSearchPage_Individual/UserTable_Individual.js index a8aa065..9fc97fa 100644 --- a/src/pages/pnspsUserSearchPage_Public/UserTable_Public.js +++ b/src/pages/pnspsUserSearchPage_Individual/UserTable_Individual.js @@ -11,7 +11,7 @@ import { useTheme } from '@mui/material/styles'; import Checkbox from '@mui/material/Checkbox'; // ==============================|| EVENT TABLE ||============================== // -export default function UserTable_Public({recordList}) { +export default function UserTable_Individual({recordList}) { const [rows, setRows] = React.useState(recordList); const [rowModesModel] = React.useState({}); const theme = useTheme(); @@ -23,7 +23,7 @@ export default function UserTable_Public({recordList}) { }, [recordList]); const handleActionClick = (id) => () => { - navigate('/publicUser/'+ id); + navigate('/indUser/'+ id); }; const columns = [ diff --git a/src/pages/pnspsUserSearchPage_Public/index.js b/src/pages/pnspsUserSearchPage_Individual/index.js similarity index 67% rename from src/pages/pnspsUserSearchPage_Public/index.js rename to src/pages/pnspsUserSearchPage_Individual/index.js index 9778609..fdf6c0c 100644 --- a/src/pages/pnspsUserSearchPage_Public/index.js +++ b/src/pages/pnspsUserSearchPage_Individual/index.js @@ -3,18 +3,19 @@ import { Grid, Typography } from '@mui/material'; import MainCard from "../../components/MainCard"; -import SearchForm from "./UserSearchForm_Public"; -import EventTable from "./UserTable_Public"; +import SearchForm from "./UserSearchForm_Individual"; +import EventTable from "./UserTable_Individual"; import {useEffect, useState} from "react"; -import axios from "axios"; -import {apiPath} from "../../auth/utils"; -import {GET_PUBLIC_USER_PATH} from "../../utils/ApiPathConst"; +//import axios from "axios"; +//import {apiPath} from "../../auth/utils"; +import {GET_IND_USER_PATH} from "../../utils/ApiPathConst"; import * as React from "react"; import LoadingComponent from "../extra-pages/LoadingComponent"; +import * as HttpUtils from "../../utils/HttpUtils"; // ==============================|| DASHBOARD - DEFAULT ||============================== // -const UserSearchPage_Public = () => { +const UserSearchPage_Individual = () => { const [record,setRecord] = useState([]); const [searchCriteria, setSearchCriteria] = useState({}); @@ -33,19 +34,13 @@ const UserSearchPage_Public = () => { }, [searchCriteria]); function getUserList(){ - - axios.get(`${apiPath}${GET_PUBLIC_USER_PATH}`, - {params: searchCriteria} - ) - .then((response) => { - if (response.status === 200) { - setRecord(response.data); - } - }) - .catch(error => { - console.log(error); - return false; - }); + HttpUtils.get({ + url: GET_IND_USER_PATH, + params: searchCriteria, + onSuccess: function(responseData){ + setRecord(responseData); + } + }); } function applySearch(input) { @@ -58,7 +53,7 @@ const UserSearchPage_Public = () => { : - View Public User + View Individual User {/*row 1*/} @@ -82,4 +77,4 @@ const UserSearchPage_Public = () => { ); }; -export default UserSearchPage_Public; +export default UserSearchPage_Individual; diff --git a/src/pages/pnspsUserSearchPage_Organization/UserSearchForm_Organization.js b/src/pages/pnspsUserSearchPage_Organization/UserSearchForm_Organization.js new file mode 100644 index 0000000..2a6505f --- /dev/null +++ b/src/pages/pnspsUserSearchPage_Organization/UserSearchForm_Organization.js @@ -0,0 +1,159 @@ +// material-ui +import { + Button, + CardContent, FormControlLabel, + Grid, TextField, + Typography +} from '@mui/material'; +import MainCard from "../../components/MainCard"; +import {useForm} from "react-hook-form"; + +import { useState} from "react"; +import Checkbox from "@mui/material/Checkbox"; +import * as React from "react"; +// ==============================|| DASHBOARD - DEFAULT ||============================== // + + +const UserSearchForm_Organization = ({applySearch}) => { + + const [type, setType] = useState([]); + const [locked, setLocked] = useState(false); + + + const { reset, register, handleSubmit } = useForm() + const onSubmit = (data) => { + + let typeArray = []; + + for(let i =0; i < type.length; i++){ + typeArray.push(type[i].label); + } + + const temp = { + username: data.userName, + fullName: data.fullName, + email: data.email, + phone: data.phone, + locked: locked, + }; + applySearch(temp); + }; + + function resetForm(){ + setType([]); + setLocked(false); + reset(); + } + + return ( + + +
    + {/*row 1*/} + + + Search Form + + + + {/*row 2*/} + + + + + + + + + + + + + + + + + + + setLocked(event.target.checked)} + name="checked" + color="primary" + size="small" + /> + } + label={Locked} + /> + + {/**/} + {/* */} + {/**/} + + + + + {/*last row*/} + + + + + + + + + + +
    +
    + ); +}; + +export default UserSearchForm_Organization; diff --git a/src/pages/pnspsUserSearchPage_Organization/UserTable_Organization.js b/src/pages/pnspsUserSearchPage_Organization/UserTable_Organization.js new file mode 100644 index 0000000..a4c3c32 --- /dev/null +++ b/src/pages/pnspsUserSearchPage_Organization/UserTable_Organization.js @@ -0,0 +1,104 @@ +// material-ui +import * as React from 'react'; +import { + DataGrid, + GridActionsCellItem, +} from "@mui/x-data-grid"; +import VisibilityIcon from '@mui/icons-material/Visibility'; +import {useEffect} from "react"; +import {useNavigate} from "react-router-dom"; +import { useTheme } from '@mui/material/styles'; +import Checkbox from '@mui/material/Checkbox'; +// ==============================|| EVENT TABLE ||============================== // + +export default function UserTable_Organization({recordList}) { + const [rows, setRows] = React.useState(recordList); + const [rowModesModel] = React.useState({}); + const theme = useTheme(); + + const navigate = useNavigate() + + useEffect(() => { + setRows(recordList); + }, [recordList]); + + const handleActionClick = (id) => () => { + navigate('/orgUser/'+ id); + }; + + const columns = [ + { + field: 'actions', + type: 'actions', + headerName: 'Actions', + width: 100, + cellClassName: 'actions', + getActions: ({id}) => { + return [ + } + label="View" + className="textPrimary" + onClick={handleActionClick(id)} + color="primary" + />] + }, + }, + { + id: 'username', + field: 'username', + headerName: 'User Name', + flex: 1, + }, + { + id: 'name', + field: 'name', + headerName: 'Full Name', + flex: 1, + }, + { + id: 'email', + field: 'email', + headerName: 'Email', + flex: 1, + }, + { + id: 'locked', + field: 'locked', + type: 'bool', + headerName: 'Locked', + flex: 1, + renderCell: (params) => { + return ( + + ); + }, + }, + ]; + + return ( +
    + +
    + ); +} diff --git a/src/pages/pnspsUserSearchPage_Organization/index.js b/src/pages/pnspsUserSearchPage_Organization/index.js new file mode 100644 index 0000000..d598b16 --- /dev/null +++ b/src/pages/pnspsUserSearchPage_Organization/index.js @@ -0,0 +1,80 @@ +// material-ui +import { + Grid, Typography +} from '@mui/material'; +import MainCard from "../../components/MainCard"; +import SearchForm from "./UserSearchForm_Organization"; +import EventTable from "./UserTable_Organization"; +import {useEffect, useState} from "react"; +//import axios from "axios"; +//import {apiPath} from "../../auth/utils"; +import * as UrlUtils from "../../utils/ApiPathConst"; +import * as React from "react"; +import LoadingComponent from "../extra-pages/LoadingComponent"; +import * as HttpUtils from "../../utils/HttpUtils"; + +// ==============================|| DASHBOARD - DEFAULT ||============================== // + +const UserSearchPage_Organization = () => { + + const [record,setRecord] = useState([]); + const [searchCriteria, setSearchCriteria] = useState({}); + const [onReady, setOnReady] = useState(false); + + useEffect(() => { + getUserList(); + }, []); + + useEffect(() => { + setOnReady(true); + }, [record]); + + useEffect(() => { + getUserList(); + }, [searchCriteria]); + + function getUserList(){ + HttpUtils.get({ + url: UrlUtils.GET_ORG_USER_PATH, + params: searchCriteria, + onSuccess: function(responseData){ + setRecord(responseData); + } + }); + } + + function applySearch(input) { + setSearchCriteria(input); + } + + return ( + !onReady ? + + : + + + View Organization User + + + {/*row 1*/} + + + + {/*row 2*/} + + + + + + + + + ); +}; + +export default UserSearchPage_Organization; diff --git a/src/routes/SettingRoutes.js b/src/routes/SettingRoutes.js index 493c096..fb17031 100644 --- a/src/routes/SettingRoutes.js +++ b/src/routes/SettingRoutes.js @@ -9,8 +9,10 @@ const SettingPage = Loadable(lazy(() => import('pages/pnspsSettingPage'))); const PasswordPolicyPage = Loadable(lazy(()=> import('pages/pnspsPasswordPolicyPage'))) const UserSearchPage = Loadable(lazy(()=>import ('pages/pnspsUserSearchPage'))); const UserMaintainPage = Loadable(lazy(() => import('pages/pnspsUserDetailPage'))); -const UserSearchPage_Public = Loadable(lazy(()=>import ('pages/pnspsUserSearchPage_Public'))); -const UserMaintainPage_Public = Loadable(lazy(() => import('pages/pnspsUserDetailPage_Public'))); +const UserSearchPage_Individual= Loadable(lazy(()=>import ('pages/pnspsUserSearchPage_Individual'))); +const UserMaintainPage_Individual = Loadable(lazy(() => import('pages/pnspsUserDetailPage_Individual'))); +const UserSearchPage_Organization= Loadable(lazy(()=>import ('pages/pnspsUserSearchPage_Organization'))); +const UserMaintainPage_Organization = Loadable(lazy(() => import('pages/pnspsUserDetailPage_Organization'))); const UserGroupSearchPage = Loadable(lazy(() => import('pages/pnspsUserGroupSearchPage'))); const UserGroupDetailPage = Loadable(lazy(() => import('pages/pnspsUserGroupDetailPage'))); @@ -37,12 +39,20 @@ const SettingRoutes = { element: }, { - path: 'publicUser', - element: + path: 'indUser', + element: }, { - path: '/publicUser/:id', - element: + path: '/indUser/:id', + element: + }, + { + path: 'orgUser', + element: + }, + { + path: '/orgUser/:id', + element: }, { path: 'setting', diff --git a/src/utils/ApiPathConst.js b/src/utils/ApiPathConst.js index 771acf4..0779cdb 100644 --- a/src/utils/ApiPathConst.js +++ b/src/utils/ApiPathConst.js @@ -9,14 +9,16 @@ export const GET_GROUP_MEMBER_LIST_PATH = '/group/member'; export const GET_GROUP_AUTH_LIST = '/group/auth/combo'; export const GET_USER_PATH = '/user'; -export const GET_PUBLIC_USER_PATH = '/user/public'; export const GET_AUTH_LIST = '/user/auth/combo'; export const GET_USER_COMBO_LIST = '/user/combo'; +export const GET_USER_LOCK = apiPath+'/user/lock'; +export const GET_USER_UNLOCK = apiPath+'/user/unlock'; -export const POST_PUBLIC_USER = apiPath+'/user/public'; -export const GET_PUBLIC_USER_LOCK = apiPath+'/user/public/lock'; -export const GET_PUBLIC_USER_UNLOCK = apiPath+'/user/public/unlock'; -export const GET_PUBLIC_USER_VERiFY = apiPath+'/user/public/verify'; +export const GET_IND_USER_PATH = apiPath+'/user/ind'; +export const GET_IND_USER_VERiFY = apiPath+'/user/ind/verify'; +export const POST_IND_USER = apiPath+'/user/ind'; + +export const GET_ORG_USER_PATH = apiPath+'/user/org'; //File Up/Download diff --git a/src/utils/HttpUtils.js b/src/utils/HttpUtils.js index bebe496..1206dcb 100644 --- a/src/utils/HttpUtils.js +++ b/src/utils/HttpUtils.js @@ -1,8 +1,10 @@ import axios from "axios"; import {FILE_UP_POST, FILE_DOWN_GET} from "../utils/ApiPathConst"; -export const get = ({url, onSuccess, onFail, onError}) =>{ - axios.get(url).then( +export const get = ({url, params, onSuccess, onFail, onError}) =>{ + axios.get(url,{ + params: params + }).then( (response)=>{onResponse(response, onSuccess, onFail);} ).catch(error => { return handleError(error,onError);