Pārlūkot izejas kodu

iAmSmart fix and dashboard

master
Anna Ho pirms 1 gada
vecāks
revīzija
d594acf422
11 mainītis faili ar 192 papildinājumiem un 16 dzēšanām
  1. +1
    -1
      src/pages/Payment/Details_Public/PaymentDetails.js
  2. +2
    -1
      src/pages/Payment/FPS/AckPage.js
  3. +1
    -1
      src/pages/Payment/PaymentCallback.js
  4. +3
    -3
      src/pages/authentication/auth-forms/AuthLoginCustom.js
  5. +30
    -0
      src/pages/dashboard/Public/Message.js
  6. +31
    -0
      src/pages/dashboard/Public/Notice.js
  7. +45
    -6
      src/pages/dashboard/Public/index.js
  8. +0
    -1
      src/pages/iAmSmart/AuthCallback/index.js
  9. +69
    -0
      src/pages/iAmSmart/DirectLoginCallback/index.js
  10. +4
    -3
      src/routes/LoginRoutes.js
  11. +6
    -0
      src/themes/palette.js

+ 1
- 1
src/pages/Payment/Details_Public/PaymentDetails.js Parādīt failu

@@ -35,7 +35,7 @@ const PaymentDetails = ({ formData,doPrint }) => {
}, [data]);

const getPaymentMethod=()=>{
let paymentmethod = data.payload.paymentdetail.paymentmethod;
let paymentmethod = data?.payload?.paymentdetail?.paymentmethod;
if("01" == paymentmethod) return "PPS";
if("02" == paymentmethod || "03" == paymentmethod) return "Credit Card";
if("04" == paymentmethod) return "FPS";


+ 2
- 1
src/pages/Payment/FPS/AckPage.js Parādīt failu

@@ -90,7 +90,7 @@ const AckPage = () => {
},
onSuccess: function(responseData){
setResponeDataData(responseData)
setPaymentId(responseData.paymentdetail.paymentid)
if (responseData.paymentdetail?.result?.paymentstatuscode === "APPR") {
localStorage.removeItem("webtoken");
localStorage.removeItem("transactionid");
@@ -111,6 +111,7 @@ const AckPage = () => {
setItemList(responseData2.paymentItemList)
setPaymentData(responseData2.data);
localStorage.removeItem("paymentId");
setPaymentId(responseData2.id)
}
});
}


+ 1
- 1
src/pages/Payment/PaymentCallback.js Parādīt failu

@@ -113,7 +113,6 @@ const Index = () => {
},
onSuccess: function (responseData) {
setResponeDataData(responseData)
setPaymentId(responseData.paymentdetail.paymentid)
if (responseData.paymentdetail?.result?.paymentstatuscode === "APPR") {
localStorage.removeItem("webtoken");
localStorage.removeItem("transactionid");
@@ -134,6 +133,7 @@ const Index = () => {
setItemList(responseData2.paymentItemList)
setPaymentData(responseData2.data);
localStorage.removeItem("paymentId");
setPaymentId(responseData2.id)
}
});
}


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

@@ -193,9 +193,9 @@ const AuthLoginCustom = () => {
}

const openApp = () => {
setTimeout(function () {
openQR();
}, 1000);
// setTimeout(function () {
// openQR();
// }, 1000);
let callbackUrl = "https://" + iAmSmartCallbackPath() + "/iamsmart/authcallback";
let url = iAmSmartAppPath + "auth"
+ "?clientID=" + clientId


+ 30
- 0
src/pages/dashboard/Public/Message.js Parādīt failu

@@ -0,0 +1,30 @@
// material-ui
import {
Stack,
Typography
} from '@mui/material';
import MainCard from "components/MainCard";
import * as React from "react";

// ==============================|| DASHBOARD - DEFAULT ||============================== //


const SearchDemandNoteForm = () => {

return (
<MainCard xs={12} md={12} lg={12}
border={false}
content={false}
sx={{ backgroundColor: '#fff' }}
>
<Stack direction="column" spacing={3}>
<Stack direction="row" spacing={3}>
<Typography></Typography>
<Typography align="justify"></Typography>
</Stack>
</Stack>
</MainCard>
);
};

export default SearchDemandNoteForm;

+ 31
- 0
src/pages/dashboard/Public/Notice.js Parādīt failu

@@ -0,0 +1,31 @@
// material-ui
import {
Typography,
Stack
} from '@mui/material';
import MainCard from "components/MainCard";
import * as React from "react";

// ==============================|| DASHBOARD - DEFAULT ||============================== //


const SearchDemandNoteForm = () => {

return (
<MainCard xs={12} md={12} lg={12}
border={false}
content={false}
spacing={2}
>
<Stack direction="column" spacing={3}>
<Stack direction="row" spacing={3}>
<Typography></Typography>
<Typography align="justify"></Typography>
</Stack>
</Stack>

</MainCard>
);
};

export default SearchDemandNoteForm;

+ 45
- 6
src/pages/dashboard/Public/index.js Parādīt failu

@@ -4,13 +4,19 @@
import {
Grid,
Typography,
Stack
Stack,
Button,
Box
} from '@mui/material';
import {
isORGLoggedIn,
} from "utils/Utils";
import { isORGLoggedIn, } from "utils/Utils";
import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png'
import {FormattedMessage} from "react-intl";
import AdsClickRoundedIcon from '@mui/icons-material/AdsClickRounded';
import * as React from "react";
import Loadable from 'components/Loadable';
const Message = Loadable(React.lazy(() => import('./Message')));
const Notice = Loadable(React.lazy(() => import('./Notice')));

// ==============================|| DASHBOARD - DEFAULT ||============================== //

const DashboardDefault = () => {
@@ -20,13 +26,13 @@ const DashboardDefault = () => {
backgroundImage: `url(${titleBackgroundImg})`,
width: '100%',
height: '100%',
backgroundSize:'contain',
backgroundSize: 'contain',
backgroundRepeat: 'no-repeat',
backgroundColor: '#0C489E',
backgroundPosition: 'right'
}
return (
<Grid container sx={{minHeight: '90vh'}} direction="column">
<Grid container sx={{ minHeight: '90vh' }} direction="column">
<Grid item xs={12} >
<div style={BackgroundHead}>
<Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center">
@@ -37,6 +43,39 @@ const DashboardDefault = () => {
</Stack>
</div>
</Grid>
<Grid item xs={12} md={12} sx={{ textAlign: "center" }}>
<Grid container justifyContent="center" spacing={2} sx={{ pt: 2 }} alignitems="stretch" >
<Grid item xs={12} lg={5} sx={{ pt: 2 }} style={{ height: '100%' }}>
<Box xs={12} md={12} sx={{ p: 4, border: '3px solid #e1edfc', borderRadius: '10px', backgroundColor: "#e1edfc" }} >
<Stack direction="row" spacing={2}>
<AdsClickRoundedIcon />
<Stack direction="column" alignItems="start">
<Typography variant="h4" >提交公共啟事申請</Typography>
<Typography >提供你的啟事內容作排版,校對及計價。</Typography>
</Stack>
</Stack>
</Box>
<Stack direction="row" justifyContent="space-between" sx={{ pl: 2, pr: 2, pt: 2 }} >
<Typography variant="h4">公告</Typography>
<Button color="gray"><u>顯示所有公告</u></Button>
</Stack>
<Box xs={12} md={12} sx={{ p: 1, border: '3px solid #eee', borderRadius: '10px' }} >
<Notice
/>
</Box>
</Grid>
<Grid item xs={12} lg={5} sx={{ pt: 2 }} style={{ height: '100%' }}>
<Stack direction="row" justifyContent="space-between" sx={{ pl: 2, pr: 2, pt: 2 }} >
<Typography variant="h4">系統消息</Typography>
<Button color="gray"><u>顯示所有消息</u></Button>
</Stack>
<Box xs={12} md={12} sx={{ p: 1, border: '3px solid #eee', borderRadius: '10px' }} >
<Message
/>
</Box>
</Grid>
</Grid>
</Grid>
</Grid>
);
};


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

@@ -56,7 +56,6 @@ const Index = () => {
},
onError:(error)=>{
console.log(error);
//window.location.assign("/iamsmart/loginFail");
}
});
}


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

@@ -0,0 +1,69 @@

import * as React from "react";
import * as HttpUtils from "utils/HttpUtils";
import * as UrlUtils from "utils/ApiPathConst";
import { useNavigate } from "react-router-dom";
import { useDispatch } from "react-redux";
import { handleLogoutFunction, handleLogin } from 'auth/index';

import Loadable from 'components/Loadable';
const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/LoadingComponent')));


// ==============================|| DASHBOARD - DEFAULT ||============================== //

const Index = () => {

const dispatch = useDispatch()
const navigate = useNavigate()

React.useEffect(() => {
goLogin();
}, []);

function goLogin(){
dispatch(handleLogoutFunction());

let params = new URLSearchParams(window.location.search)
if(params.get("code")){
HttpUtils.post({
url: UrlUtils.GET_SMART_LOGIN,
params:{
code: params.get("code")
},
onSuccess: (responseData) => {
console.log("responseData");
console.log(responseData);
const userData = {
id: responseData.id,
fullenName: responseData.name,
fullchName: responseData.chName,
email: responseData.email,
type: responseData.type,
role: responseData.role,
abilities: responseData.abilities,
creditor: responseData.creditor,
//avatar: require('src/assets/images/users/avatar-3.png').default,
}
const data = { ...userData, accessToken: responseData.accessToken, refreshToken: responseData.refreshToken }
dispatch(handleLogin(data))
navigate('/dashboard');
},
onFail: (response)=>{
console.log("Fail");
console.log(response);
window.location.assign("/iamsmart/loginFail");
},
onError:(error)=>{
console.log(error);
}
});
}
}

return (
<LoadingComponent />
);
};

export default Index;

+ 4
- 3
src/routes/LoginRoutes.js Parādīt failu

@@ -12,7 +12,8 @@ const RegisterForm = Loadable(lazy(() => import('pages/authentication/Register')
const BusRegisterForm = Loadable(lazy(() => import('pages/authentication/BusRegister')));
const IAmSmartRegister = Loadable(lazy(() => import('pages/authentication/IAmSmartRegister')));
const ErrorPage = Loadable(lazy(() => import('pages/extra-pages/ErrorPage')));
const IAmSmart_FallCallback = Loadable(lazy(() => import('pages/iAmSmart/FallCallback')));
//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 IAmSmart_SuccessCallback = Loadable(lazy(() => import('pages/iAmSmart/SuccessCallback')));
const IAmSmart_AuthCallback = Loadable(lazy(() => import('pages/iAmSmart/AuthCallback')));
@@ -60,11 +61,11 @@ const LoginRoutes = {
},
{
path: 'iamsmart/logincallback',
element: <IAmSmart_FallCallback/>
element: <IAmSmart_AuthCallback/>
},
{
path: 'iamsmart/loginfallback',
element: <IAmSmart_FallCallback/>
element: <IAmSmart_FailCallback/>
},
{
path: 'iamsmart/authcallback',


+ 6
- 0
src/themes/palette.js Parādīt failu

@@ -53,6 +53,12 @@ const Palette = (mode) => {
paper: paletteColor.grey[0],
default: paletteColor.grey.A50
},
gray: {
main: '#777',
light: '#777',
dark: '#777',
contrastText: '#FFF',
},
white: {
main: '#fff',
light: '#fff',


Notiek ielāde…
Atcelt
Saglabāt