Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f2e278a8cf | |||
| 9b2145ff00 | |||
| 7ce87a3ee8 | |||
| 37fa170108 | |||
| 9a269b5732 | |||
| f766c19465 | |||
| 30a344970a | |||
| e4b1ceae30 | |||
| aae99a7b50 |
@@ -9,3 +9,5 @@ REACT_APP_APPSITE=" https://myfitapp.mermsemr.com"
|
|||||||
|
|
||||||
REACT_APP_AUX_ENDPOINT = "https://devapi.mermsemr.com/en/desktop/api/v2/myfit"
|
REACT_APP_AUX_ENDPOINT = "https://devapi.mermsemr.com/en/desktop/api/v2/myfit"
|
||||||
REACT_APP_USERS_ENDPOINT = "https://devapi.mermsemr.com/en/desktop/api/v2/myfituser"
|
REACT_APP_USERS_ENDPOINT = "https://devapi.mermsemr.com/en/desktop/api/v2/myfituser"
|
||||||
|
|
||||||
|
REACT_APP_SESSION_EXPIRE_MINUTES = 5
|
||||||
@@ -145,6 +145,7 @@ export default function AuthProfile() {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
<ActivitiesTab />
|
||||||
</div>
|
</div>
|
||||||
</Layout>
|
</Layout>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -20,12 +20,12 @@ export default function Login() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// email
|
// email
|
||||||
const [email, setMail] = useState("support@mermsemr.com");
|
const [email, setMail] = useState("");
|
||||||
const handleEmail = (e) => {
|
const handleEmail = (e) => {
|
||||||
setMail(e.target.value);
|
setMail(e.target.value);
|
||||||
};
|
};
|
||||||
// password
|
// password
|
||||||
const [password, setPassword] = useState("123456");
|
const [password, setPassword] = useState("");
|
||||||
const handlePassword = (e) => {
|
const handlePassword = (e) => {
|
||||||
setPassword(e.target.value);
|
setPassword(e.target.value);
|
||||||
};
|
};
|
||||||
@@ -39,9 +39,11 @@ export default function Login() {
|
|||||||
};
|
};
|
||||||
const loginResult = await userApi.logInUser(postData); // just for a test
|
const loginResult = await userApi.logInUser(postData); // just for a test
|
||||||
// if (email === "support@mermsemr.com") {
|
// if (email === "support@mermsemr.com") {
|
||||||
if (loginResult.data.status > 0) { // just for a start
|
if (loginResult.data.status > 0 && loginResult.data.session_token !='') { // just for a start
|
||||||
localStorage.setItem("email", `${email}`);
|
localStorage.setItem("email", `${email}`);
|
||||||
|
localStorage.setItem("session_token", `${loginResult.data.session_token}`);
|
||||||
setLoginLoading(true);
|
setLoginLoading(true);
|
||||||
|
// userApi.getUserReminders(); //testing
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
toast.success("Login Successfully");
|
toast.success("Login Successfully");
|
||||||
navigate("/", { replace: true });
|
navigate("/", { replace: true });
|
||||||
|
|||||||
@@ -104,9 +104,7 @@ export default function SellHistoryMarketVisitorAnalytic({ className }) {
|
|||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
<div className="content-wrapper w-full lg:flex xl:space-x-8 lg:space-x-4">
|
<div className="content-wrapper w-full lg:flex xl:space-x-8 lg:space-x-4">
|
||||||
<div className="lg:w-1/2 w-full mb-10 lg:mb-0">
|
|
||||||
<SellHistoryWidget />
|
|
||||||
</div>
|
|
||||||
<div className="flex-1 ">
|
<div className="flex-1 ">
|
||||||
<div className="market-visitor w-full md:p-8 p-4 h-full bg-white dark:bg-dark-white overflow-hidden rounded-2xl section-shadow">
|
<div className="market-visitor w-full md:p-8 p-4 h-full bg-white dark:bg-dark-white overflow-hidden rounded-2xl section-shadow">
|
||||||
<div className="flex flex-col justify-between h-full">
|
<div className="flex flex-col justify-between h-full">
|
||||||
@@ -127,6 +125,11 @@ export default function SellHistoryMarketVisitorAnalytic({ className }) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div className="lg:w-1/2 w-full mb-10 lg:mb-0">
|
||||||
|
<SellHistoryWidget />
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ export default function Layout({ children }) {
|
|||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const logOut = () => {
|
const logOut = () => {
|
||||||
localStorage.removeItem("email");
|
localStorage.removeItem("email");
|
||||||
localStorage.clear();
|
localStorage.removeItem('session_token');
|
||||||
toast.success("Come Back Soon", {
|
toast.success("Come Back Soon", {
|
||||||
icon: `🙂`,
|
icon: `🙂`,
|
||||||
});
|
});
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,12 +1,29 @@
|
|||||||
import React from "react";
|
import React from 'react'
|
||||||
import HistoryAnalyticsCard from "../Cards/HistoryAnalyticsCard";
|
import HistoryAnalyticsCard from '../Cards/HistoryAnalyticsCard'
|
||||||
import Layout from "../Partials/Layout";
|
import Layout from '../Partials/Layout'
|
||||||
import ReminderTable from "./ReminderTable";
|
import ReminderTable from './ReminderTable'
|
||||||
|
import { Link } from 'react-router-dom'
|
||||||
|
|
||||||
export default function Reminders() {
|
export default function Reminders() {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Layout>
|
<Layout>
|
||||||
|
<div className="content-wrapper-profile-only w-full mb-6">
|
||||||
|
<div className="auth-tab-content relative mb-10">
|
||||||
|
<div className="lg:flex justify-between">
|
||||||
|
<div className="tab-items"></div>
|
||||||
|
<div style={{ transform: 'translateY(-22px)' }}>
|
||||||
|
<Link
|
||||||
|
to="/add-reminder"
|
||||||
|
className="btn-gradient lg:flex hidden w-[153px] h-[46px] rounded-full text-white justify-center items-center"
|
||||||
|
>
|
||||||
|
Add Reminder
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="hidden lg:block w-full h-[1px] bg-[#DCD5FE] dark:bg-[#5356fb29] absolute top-[42px] left-0"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div className="history-wrapper w-full mb-10">
|
<div className="history-wrapper w-full mb-10">
|
||||||
<div className="main-wrapper w-full">
|
<div className="main-wrapper w-full">
|
||||||
<ReminderTable />
|
<ReminderTable />
|
||||||
@@ -14,5 +31,5 @@ export default function Reminders() {
|
|||||||
</div>
|
</div>
|
||||||
</Layout>
|
</Layout>
|
||||||
</>
|
</>
|
||||||
);
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,246 +8,135 @@ export default function LoginActivityTab() {
|
|||||||
<table className="w-full text-sm text-left text-gray-500 dark:text-gray-400">
|
<table className="w-full text-sm text-left text-gray-500 dark:text-gray-400">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr className="text-base text-thin-light-gray border-b dark:border-[#5356fb29] default-border-b dark:border-[#5356fb29] ottom ">
|
<tr className="text-base text-thin-light-gray border-b dark:border-[#5356fb29] default-border-b dark:border-[#5356fb29] ottom ">
|
||||||
<td className="py-4 text-center">OS</td>
|
<td className="py-4 text-center">Channel</td>
|
||||||
<td className="py-4 text-center">Browser</td>
|
<td className="py-4 text-center">Date</td>
|
||||||
<td className="py-4 text-center">Location</td>
|
<td className="py-4 text-center">Location</td>
|
||||||
<td className="py-4 text-center">Last session</td>
|
|
||||||
<td className="py-4 text-center">Status</td>
|
|
||||||
<td className="py-4 text-center"></td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<tr className="bg-white dark:bg-dark-white border-b dark:border-[#5356fb29] hover:bg-gray-50">
|
<tr className="bg-white dark:bg-dark-white border-b dark:border-[#5356fb29] hover:bg-gray-50">
|
||||||
<td className="text-center py-4">
|
<td className="text-center py-4">
|
||||||
<div className="flex items-center justify-center">
|
<div className="flex items-center justify-center">
|
||||||
<span className="text-base text-dark-gray dark:text-white font-medium whitespace-nowrap px-2">
|
<span className="text-base text-dark-gray dark:text-white font-medium whitespace-nowrap px-2">
|
||||||
Windows
|
Desktop
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td className="text-center py-4">
|
<td className="text-center py-4">
|
||||||
<div className="flex space-x-1 items-center justify-center">
|
<div className="flex space-x-1 items-center justify-center">
|
||||||
<span className="text-base text-dark-gray dark:text-white font-medium whitespace-nowrap px-2">
|
<span className="text-base text-dark-gray dark:text-white font-medium whitespace-nowrap px-2">
|
||||||
Google Chrome
|
10-10-2035
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td className="text-center py-4">
|
<td className="text-center py-4">
|
||||||
<span className="text-base text-dark-gray dark:text-white whitespace-nowrap px-2">
|
<span className="text-base text-dark-gray dark:text-white whitespace-nowrap px-2">
|
||||||
Dhaka , Bangladesh
|
10.0.0.1000
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td className="text-center py-4">
|
|
||||||
<span className="text-base text-thin-light-gray font-medium whitespace-nowrap px-2">
|
|
||||||
2 days ago
|
|
||||||
</span>
|
|
||||||
</td>
|
|
||||||
<td className="text-center py-4">
|
|
||||||
<span className="text-sm px-[10px] py-[6px] rounded-full bg-light-green text-white capitalize">
|
|
||||||
active
|
|
||||||
</span>
|
|
||||||
</td>
|
|
||||||
<td className="text-center py-4">
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
className=" text-thin-light-gray hover:text-red-400"
|
|
||||||
>
|
|
||||||
<Icons name="deep-delete" />
|
|
||||||
</button>
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<tr className="bg-white dark:bg-dark-white border-b dark:border-[#5356fb29] hover:bg-gray-50">
|
<tr className="bg-white dark:bg-dark-white border-b dark:border-[#5356fb29] hover:bg-gray-50">
|
||||||
<td className="text-center py-4">
|
<td className="text-center py-4">
|
||||||
<div className="flex items-center justify-center">
|
<div className="flex items-center justify-center">
|
||||||
<span className="text-base text-dark-gray dark:text-white font-medium whitespace-nowrap px-2">
|
<span className="text-base text-dark-gray dark:text-white font-medium whitespace-nowrap px-2">
|
||||||
Mac
|
Desktop
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td className="text-center py-4">
|
<td className="text-center py-4">
|
||||||
<div className="flex space-x-1 items-center justify-center">
|
<div className="flex space-x-1 items-center justify-center">
|
||||||
<span className="text-base text-dark-gray dark:text-white font-medium whitespace-nowrap px-2">
|
<span className="text-base text-dark-gray dark:text-white font-medium whitespace-nowrap px-2">
|
||||||
Firefox
|
10-10-2035
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td className="text-center py-4">
|
<td className="text-center py-4">
|
||||||
<span className="text-base text-dark-gray dark:text-white whitespace-nowrap px-2">
|
<span className="text-base text-dark-gray dark:text-white whitespace-nowrap px-2">
|
||||||
Tokyo,japan
|
10.0.0.1000
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td className="text-center py-4">
|
|
||||||
<span className="text-base text-thin-light-gray font-medium whitespace-nowrap px-2">
|
|
||||||
5 days ago
|
|
||||||
</span>
|
|
||||||
</td>
|
|
||||||
<td className="text-center py-4">
|
|
||||||
<span className="text-sm px-[10px] py-[6px] rounded-full bg-light-red text-white capitalize">
|
|
||||||
Inactive
|
|
||||||
</span>
|
|
||||||
</td>
|
|
||||||
<td className="text-center py-4">
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
className=" text-thin-light-gray hover:text-red-400"
|
|
||||||
>
|
|
||||||
<Icons name="deep-delete" />
|
|
||||||
</button>
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<tr className="bg-white dark:bg-dark-white border-b dark:border-[#5356fb29] hover:bg-gray-50">
|
<tr className="bg-white dark:bg-dark-white border-b dark:border-[#5356fb29] hover:bg-gray-50">
|
||||||
<td className="text-center py-4">
|
<td className="text-center py-4">
|
||||||
<div className="flex items-center justify-center">
|
<div className="flex items-center justify-center">
|
||||||
<span className="text-base text-dark-gray dark:text-white font-medium whitespace-nowrap px-2">
|
<span className="text-base text-dark-gray dark:text-white font-medium whitespace-nowrap px-2">
|
||||||
App
|
Desktop
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td className="text-center py-4">
|
<td className="text-center py-4">
|
||||||
<div className="flex space-x-1 items-center justify-center">
|
<div className="flex space-x-1 items-center justify-center">
|
||||||
<span className="text-base text-dark-gray dark:text-white font-medium whitespace-nowrap px-2">
|
<span className="text-base text-dark-gray dark:text-white font-medium whitespace-nowrap px-2">
|
||||||
App
|
10-10-2035
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td className="text-center py-4">
|
<td className="text-center py-4">
|
||||||
<span className="text-base text-dark-gray dark:text-white whitespace-nowrap px-2">
|
<span className="text-base text-dark-gray dark:text-white whitespace-nowrap px-2">
|
||||||
Barhin,Dubai
|
10.0.0.1000
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td className="text-center py-4">
|
|
||||||
<span className="text-base text-thin-light-gray font-medium whitespace-nowrap px-2">
|
|
||||||
2 days ago
|
|
||||||
</span>
|
|
||||||
</td>
|
|
||||||
<td className="text-center py-4">
|
|
||||||
<span className="text-sm px-[10px] py-[6px] rounded-full bg-light-green text-white capitalize">
|
|
||||||
active
|
|
||||||
</span>
|
|
||||||
</td>
|
|
||||||
<td className="text-center py-4">
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
className=" text-thin-light-gray hover:text-red-400"
|
|
||||||
>
|
|
||||||
<Icons name="deep-delete" />
|
|
||||||
</button>
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<tr className="bg-white dark:bg-dark-white border-b dark:border-[#5356fb29] hover:bg-gray-50">
|
<tr className="bg-white dark:bg-dark-white border-b dark:border-[#5356fb29] hover:bg-gray-50">
|
||||||
<td className="text-center py-4">
|
<td className="text-center py-4">
|
||||||
<div className="flex items-center justify-center">
|
<div className="flex items-center justify-center">
|
||||||
<span className="text-base text-dark-gray dark:text-white font-medium whitespace-nowrap px-2">
|
<span className="text-base text-dark-gray dark:text-white font-medium whitespace-nowrap px-2">
|
||||||
Windows
|
Desktop
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td className="text-center py-4">
|
<td className="text-center py-4">
|
||||||
<div className="flex space-x-1 items-center justify-center">
|
<div className="flex space-x-1 items-center justify-center">
|
||||||
<span className="text-base text-dark-gray dark:text-white font-medium whitespace-nowrap px-2">
|
<span className="text-base text-dark-gray dark:text-white font-medium whitespace-nowrap px-2">
|
||||||
Google Chrome
|
10-10-2035
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td className="text-center py-4">
|
<td className="text-center py-4">
|
||||||
<span className="text-base text-dark-gray dark:text-white whitespace-nowrap px-2">
|
<span className="text-base text-dark-gray dark:text-white whitespace-nowrap px-2">
|
||||||
Dhaka , Bangladesh
|
10.0.0.1000
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td className="text-center py-4">
|
|
||||||
<span className="text-base text-thin-light-gray font-medium whitespace-nowrap px-2">
|
|
||||||
2 days ago
|
|
||||||
</span>
|
|
||||||
</td>
|
|
||||||
<td className="text-center py-4">
|
|
||||||
<span className="text-sm px-[10px] py-[6px] rounded-full bg-light-green text-white capitalize">
|
|
||||||
active
|
|
||||||
</span>
|
|
||||||
</td>
|
|
||||||
<td className="text-center py-4">
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
className=" text-thin-light-gray hover:text-red-400"
|
|
||||||
>
|
|
||||||
<Icons name="deep-delete" />
|
|
||||||
</button>
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<tr className="bg-white dark:bg-dark-white border-b dark:border-[#5356fb29] hover:bg-gray-50">
|
<tr className="bg-white dark:bg-dark-white border-b dark:border-[#5356fb29] hover:bg-gray-50">
|
||||||
<td className="text-center py-4">
|
<td className="text-center py-4">
|
||||||
<div className="flex items-center justify-center">
|
<div className="flex items-center justify-center">
|
||||||
<span className="text-base text-dark-gray dark:text-white font-medium whitespace-nowrap px-2">
|
<span className="text-base text-dark-gray dark:text-white font-medium whitespace-nowrap px-2">
|
||||||
Mac
|
Desktop
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td className="text-center py-4">
|
<td className="text-center py-4">
|
||||||
<div className="flex space-x-1 items-center justify-center">
|
<div className="flex space-x-1 items-center justify-center">
|
||||||
<span className="text-base text-dark-gray dark:text-white font-medium whitespace-nowrap px-2">
|
<span className="text-base text-dark-gray dark:text-white font-medium whitespace-nowrap px-2">
|
||||||
Firefox
|
10-10-2035
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td className="text-center py-4">
|
<td className="text-center py-4">
|
||||||
<span className="text-base text-dark-gray dark:text-white whitespace-nowrap px-2">
|
<span className="text-base text-dark-gray dark:text-white whitespace-nowrap px-2">
|
||||||
Tokyo,japan
|
10.0.0.1000
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td className="text-center py-4">
|
|
||||||
<span className="text-base text-thin-light-gray font-medium whitespace-nowrap px-2">
|
|
||||||
5 days ago
|
|
||||||
</span>
|
|
||||||
</td>
|
|
||||||
<td className="text-center py-4">
|
|
||||||
<span className="text-sm px-[10px] py-[6px] rounded-full bg-light-red text-white capitalize">
|
|
||||||
Inactive
|
|
||||||
</span>
|
|
||||||
</td>
|
|
||||||
<td className="text-center py-4">
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
className=" text-thin-light-gray hover:text-red-400"
|
|
||||||
>
|
|
||||||
<Icons name="deep-delete" />
|
|
||||||
</button>
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<tr className="bg-white dark:bg-dark-white border-b dark:border-[#5356fb29] hover:bg-gray-50">
|
<tr className="bg-white dark:bg-dark-white border-b dark:border-[#5356fb29] hover:bg-gray-50">
|
||||||
<td className="text-center py-4">
|
<td className="text-center py-4">
|
||||||
<div className="flex items-center justify-center">
|
<div className="flex items-center justify-center">
|
||||||
<span className="text-base text-dark-gray dark:text-white font-medium whitespace-nowrap px-2">
|
<span className="text-base text-dark-gray dark:text-white font-medium whitespace-nowrap px-2">
|
||||||
App
|
Mobile
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td className="text-center py-4">
|
<td className="text-center py-4">
|
||||||
<div className="flex space-x-1 items-center justify-center">
|
<div className="flex space-x-1 items-center justify-center">
|
||||||
<span className="text-base text-dark-gray dark:text-white font-medium whitespace-nowrap px-2">
|
<span className="text-base text-dark-gray dark:text-white font-medium whitespace-nowrap px-2">
|
||||||
App
|
10-10-2035
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td className="text-center py-4">
|
<td className="text-center py-4">
|
||||||
<span className="text-base text-dark-gray dark:text-white whitespace-nowrap px-2">
|
<span className="text-base text-dark-gray dark:text-white whitespace-nowrap px-2">
|
||||||
Barhin,Dubai
|
10.0.0.1000
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td className="text-center py-4">
|
|
||||||
<span className="text-base text-thin-light-gray font-medium whitespace-nowrap px-2">
|
|
||||||
2 days ago
|
|
||||||
</span>
|
|
||||||
</td>
|
|
||||||
<td className="text-center py-4">
|
|
||||||
<span className="text-sm px-[10px] py-[6px] rounded-full bg-light-green text-white capitalize">
|
|
||||||
active
|
|
||||||
</span>
|
|
||||||
</td>
|
|
||||||
<td className="text-center py-4">
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
className=" text-thin-light-gray hover:text-red-400"
|
|
||||||
>
|
|
||||||
<Icons name="deep-delete" />
|
|
||||||
</button>
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -11,17 +11,30 @@ class usersService {
|
|||||||
/*
|
/*
|
||||||
clean up the request data here
|
clean up the request data here
|
||||||
*/
|
*/
|
||||||
|
localStorage.setItem("session_token", ``);
|
||||||
return this.postAuxEnd("/login", reqData);
|
return this.postAuxEnd("/login", reqData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getUserReminders(){
|
||||||
|
return this.getAuxEnd("/reminders", null);
|
||||||
|
}
|
||||||
//---------------------------------------- -----
|
//---------------------------------------- -----
|
||||||
//---------------------------------------- -----
|
//---------------------------------------- -----
|
||||||
// Unified call below
|
// Unified call below
|
||||||
//---------------------------------------- -----
|
//---------------------------------------- -----
|
||||||
//---------------------------------------- -----
|
//---------------------------------------- -----
|
||||||
getAuxEnd(uri, reqData) {
|
getAuxEnd(uri, reqData) {
|
||||||
|
debugger;
|
||||||
|
const session_token = localStorage.getItem("session_token");
|
||||||
|
let axiosConfig = {
|
||||||
|
headers: {
|
||||||
|
'Accept': 'application/json',
|
||||||
|
'Content-Type': 'application/json;charset=UTF-8',
|
||||||
|
'Authorization': `Basic ${session_token}`,
|
||||||
|
}
|
||||||
|
};
|
||||||
const endPoint = process.env.REACT_APP_USERS_ENDPOINT + uri;
|
const endPoint = process.env.REACT_APP_USERS_ENDPOINT + uri;
|
||||||
return Axios.get(endPoint)
|
return Axios.get(endPoint,axiosConfig)
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
// console.log(response);
|
// console.log(response);
|
||||||
// res = response;
|
// res = response;
|
||||||
@@ -44,13 +57,12 @@ class usersService {
|
|||||||
|
|
||||||
postAuxEnd(uri, reqData) {
|
postAuxEnd(uri, reqData) {
|
||||||
const endPoint = process.env.REACT_APP_USERS_ENDPOINT + uri;
|
const endPoint = process.env.REACT_APP_USERS_ENDPOINT + uri;
|
||||||
const token = '..your token..'
|
const session_token = localStorage.getItem("session_token");
|
||||||
let axiosConfig = {
|
let axiosConfig = {
|
||||||
headers: {
|
headers: {
|
||||||
'Accept': 'application/json',
|
'Accept': 'application/json',
|
||||||
'Access-Control-Allow-Origin': '*',
|
|
||||||
'Content-Type': 'application/json;charset=UTF-8',
|
'Content-Type': 'application/json;charset=UTF-8',
|
||||||
'Authorization': `Basic ${token}`,
|
'Authorization': `Basic ${session_token}`,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
//Access-Control-Allow-Origin
|
//Access-Control-Allow-Origin
|
||||||
@@ -60,7 +72,7 @@ class usersService {
|
|||||||
};
|
};
|
||||||
// Axios.defaults.headers.post['Content-Type'] ='application/json;charset=utf-8';
|
// Axios.defaults.headers.post['Content-Type'] ='application/json;charset=utf-8';
|
||||||
// Axios.defaults.headers.post['Access-Control-Allow-Origin'] = '*'; //,axiosConfig
|
// Axios.defaults.headers.post['Access-Control-Allow-Origin'] = '*'; //,axiosConfig
|
||||||
return Axios.post(endPoint, reqData)
|
return Axios.post(endPoint, reqData,axiosConfig)
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
console.log(response);
|
console.log(response);
|
||||||
// res = response;
|
// res = response;
|
||||||
|
|||||||
+23
-1
@@ -1,7 +1,29 @@
|
|||||||
import React from "react";
|
import React, {useEffect} from "react";
|
||||||
import Home from "../components/Home";
|
import Home from "../components/Home";
|
||||||
|
import { useNavigate } from "react-router-dom";
|
||||||
|
import { useDispatch, useSelector } from "react-redux";
|
||||||
|
import { toast } from "react-toastify";
|
||||||
|
|
||||||
export default function HomePages() {
|
export default function HomePages() {
|
||||||
|
|
||||||
|
const { drawer } = useSelector((state) => state.drawer);
|
||||||
|
const dispatch = useDispatch();
|
||||||
|
const navigate = useNavigate();
|
||||||
|
const logOut = () => {
|
||||||
|
localStorage.removeItem("email");
|
||||||
|
localStorage.removeItem('session_token');
|
||||||
|
toast.success("Come Back Soon", {
|
||||||
|
icon: `🙂`,
|
||||||
|
});
|
||||||
|
|
||||||
|
navigate("/login", { replace: true });
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(()=>{
|
||||||
|
setTimeout(()=>{
|
||||||
|
logOut()
|
||||||
|
}, 300000) //expires user login session after 5 minutes
|
||||||
|
},[])
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Home />
|
<Home />
|
||||||
|
|||||||
Reference in New Issue
Block a user