|
-
- import * as React from "react";
- import * as HttpUtils from "utils/HttpUtils";
- import * as UrlUtils from "utils/ApiPathConst";
- import { useNavigate } from "react-router-dom";
- import Loadable from 'components/Loadable';
- const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/LoadingComponent')));
-
-
- // ==============================|| DASHBOARD - DEFAULT ||============================== //
-
- const Index = () => {
-
- const navigate = useNavigate()
-
- React.useEffect(() => {
- getPrfile();
- }, []);
-
- function getPrfile(){
- let params = new URLSearchParams(window.location.search)
- if(params.get("code")){
- HttpUtils.post({
- url: UrlUtils.GET_SMART_PROFILE,
- params:{
- code: params.get("code")
- },
- onSuccess: (responseData) => {
- navigate('/iAmSmartRegisterFrom', { state: { responseData: responseData } });
- },
- onFail: (response)=>{
- console.log("Fail");
- console.log(response);
- window.location.assign("/register");
- },
- onError:(error)=>{
- console.log(error);
- window.location.assign("/register");
- }
- });
- }else{
- window.location.assign("/register");
- }
- }
-
- return (
- <LoadingComponent />
- );
- };
-
- export default Index;
|