Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 568de8c8ec |
@@ -8,4 +8,4 @@ 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/myfitusers"
|
||||||
Generated
-13751
File diff suppressed because it is too large
Load Diff
+1
-3
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "myFit-App",
|
"name": "nft-max-react",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -8,10 +8,8 @@
|
|||||||
"@testing-library/jest-dom": "^5.11.4",
|
"@testing-library/jest-dom": "^5.11.4",
|
||||||
"@testing-library/react": "^11.1.0",
|
"@testing-library/react": "^11.1.0",
|
||||||
"@testing-library/user-event": "^12.1.10",
|
"@testing-library/user-event": "^12.1.10",
|
||||||
"axios": "^0.24.0",
|
|
||||||
"chart.js": "^3.7.1",
|
"chart.js": "^3.7.1",
|
||||||
"chartjs": "^0.3.24",
|
"chartjs": "^0.3.24",
|
||||||
"cors": "^2.8.5",
|
|
||||||
"faker": "^6.6.6",
|
"faker": "^6.6.6",
|
||||||
"react": "^18.0.0",
|
"react": "^18.0.0",
|
||||||
"react-chartjs-2": "^4.1.0",
|
"react-chartjs-2": "^4.1.0",
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import { toast } from "react-toastify";
|
|||||||
import googleLogo from "../../../assets/images/google-logo.svg";
|
import googleLogo from "../../../assets/images/google-logo.svg";
|
||||||
// import titleShape from "../../../assets/images/shape/title-shape.svg";
|
// import titleShape from "../../../assets/images/shape/title-shape.svg";
|
||||||
import titleShape from "../../../assets/images/shape/login_straight_underline.svg";
|
import titleShape from "../../../assets/images/shape/login_straight_underline.svg";
|
||||||
import usersService from "../../../services/UsersService";
|
|
||||||
import InputCom from "../../Helpers/Inputs/InputCom";
|
import InputCom from "../../Helpers/Inputs/InputCom";
|
||||||
import AuthLayout from "../AuthLayout";
|
import AuthLayout from "../AuthLayout";
|
||||||
|
|
||||||
@@ -20,7 +19,7 @@ export default function Login() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// email
|
// email
|
||||||
const [email, setMail] = useState("support@mermsemr.com");
|
const [email, setMail] = useState("support@chiefsoft.com");
|
||||||
const handleEmail = (e) => {
|
const handleEmail = (e) => {
|
||||||
setMail(e.target.value);
|
setMail(e.target.value);
|
||||||
};
|
};
|
||||||
@@ -30,16 +29,9 @@ export default function Login() {
|
|||||||
setPassword(e.target.value);
|
setPassword(e.target.value);
|
||||||
};
|
};
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const userApi = new usersService();
|
const doLogin = () => {
|
||||||
const doLogin = async () => {
|
|
||||||
if (email !== "" && password !== "") {
|
if (email !== "" && password !== "") {
|
||||||
var postData = {
|
if (email === "support@chiefsoft.com") {
|
||||||
username: email,
|
|
||||||
password: password
|
|
||||||
};
|
|
||||||
const loginResult = await userApi.logInUser(postData); // just for a test
|
|
||||||
// if (email === "support@mermsemr.com") {
|
|
||||||
if (loginResult.data.status > 0) { // just for a start
|
|
||||||
localStorage.setItem("email", `${email}`);
|
localStorage.setItem("email", `${email}`);
|
||||||
setLoginLoading(true);
|
setLoginLoading(true);
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
@@ -65,7 +57,7 @@ export default function Login() {
|
|||||||
<h1 className="text-5xl font-bold leading-[74px] text-dark-gray dark:text-white">
|
<h1 className="text-5xl font-bold leading-[74px] text-dark-gray dark:text-white">
|
||||||
Log In
|
Log In
|
||||||
</h1>
|
</h1>
|
||||||
<div className="shape mb-[10px]">
|
<div className="shape -mt-2">
|
||||||
<img src={titleShape} alt="shape" />
|
<img src={titleShape} alt="shape" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -74,7 +66,7 @@ export default function Login() {
|
|||||||
<InputCom
|
<InputCom
|
||||||
value={email}
|
value={email}
|
||||||
inputHandler={handleEmail}
|
inputHandler={handleEmail}
|
||||||
placeholder="support@mermsemr.com"
|
placeholder="support@chiefsoft.com"
|
||||||
label="Email Address"
|
label="Email Address"
|
||||||
name="email"
|
name="email"
|
||||||
type="email"
|
type="email"
|
||||||
|
|||||||
@@ -22,11 +22,11 @@ export default function SignUp() {
|
|||||||
</div>
|
</div>
|
||||||
*/}
|
*/}
|
||||||
<div className="thumbnail flex justify-center">
|
<div className="thumbnail flex justify-center">
|
||||||
{/*<img src={loginThumb} alt="login-thumb" /> */}
|
{/*<img src={loginThumb} alt="login-thumb" /> */}
|
||||||
</div>
|
</div>
|
||||||
<div className="article w-[600px]">
|
<div className="article w-[600px]">
|
||||||
<p className="text-[60px] font-bold leading-[72px] text-white">
|
<p className="text-[60px] font-bold leading-[72px] text-white">
|
||||||
Welcome to myFit
|
Welcome to myFit
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -37,7 +37,7 @@ export default function SignUp() {
|
|||||||
<h1 className="sm:text-5xl text-4xl font-bold text-dark-gray dark:text-white leading-2">
|
<h1 className="sm:text-5xl text-4xl font-bold text-dark-gray dark:text-white leading-2">
|
||||||
Create Account
|
Create Account
|
||||||
</h1>
|
</h1>
|
||||||
<div className="shape sm:w-[377px] w-[280px] mb-[10px] ml-5">
|
<div className="shape sm:w-[377px] w-[280px] -mt-2.5 ml-5">
|
||||||
<img src={titleShape} alt="shape" />
|
<img src={titleShape} alt="shape" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,83 +0,0 @@
|
|||||||
import React from "react";
|
|
||||||
import Axios from "axios";
|
|
||||||
|
|
||||||
class SiteService {
|
|
||||||
constructor() {
|
|
||||||
console.log("Er are here anyway");
|
|
||||||
}
|
|
||||||
// Blog Data {Get}
|
|
||||||
blogData() {
|
|
||||||
return this.getAuxEnd("/blogdata", null);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Country Data {GET}
|
|
||||||
countryData() {
|
|
||||||
return this.getAuxEnd("/country", null);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Contact Data{POST}
|
|
||||||
contactData() {
|
|
||||||
return this.postAuxEnd("/contact", null)
|
|
||||||
}
|
|
||||||
|
|
||||||
faqData() {
|
|
||||||
return this.getAuxEnd("/faq", null);
|
|
||||||
}
|
|
||||||
|
|
||||||
priceData() {
|
|
||||||
return this.getAuxEnd("/pricing", null);
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------- -----
|
|
||||||
//---------------------------------------- -----
|
|
||||||
// Unified call below
|
|
||||||
//---------------------------------------- -----
|
|
||||||
//---------------------------------------- -----
|
|
||||||
getAuxEnd(uri, reqData) {
|
|
||||||
const endPoint = process.env.REACT_APP_AUX_ENDPOINT + uri;
|
|
||||||
return Axios.get(endPoint)
|
|
||||||
.then((response) => {
|
|
||||||
// console.log(response);
|
|
||||||
// res = response;
|
|
||||||
// console.log("~~~~~~~ Toks2 GET ~~~~~~~~");
|
|
||||||
return response;
|
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
if (error.response) {
|
|
||||||
//response status is an error code
|
|
||||||
console.log(error.response.status);
|
|
||||||
} else if (error.request) {
|
|
||||||
//response not received though the request was sent
|
|
||||||
console.log(error.request);
|
|
||||||
} else {
|
|
||||||
//an error occurred when setting up the request
|
|
||||||
console.log(error.message);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
postAuxEnd(uri, reqData) {
|
|
||||||
const endPoint = process.env.REACT_APP_AUX_ENDPOINT + uri;
|
|
||||||
return Axios.post(endPoint, reqData)
|
|
||||||
.then((response) => {
|
|
||||||
console.log(response);
|
|
||||||
// res = response;
|
|
||||||
console.log("~~~~~~~ Toks2 POST ~~~~~~~~");
|
|
||||||
return response;
|
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
if (error.response) {
|
|
||||||
//response status is an error code
|
|
||||||
console.log(error.response.status);
|
|
||||||
} else if (error.request) {
|
|
||||||
//response not received though the request was sent
|
|
||||||
console.log(error.request);
|
|
||||||
} else {
|
|
||||||
//an error occurred when setting up the request
|
|
||||||
console.log(error.message);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export default SiteService;
|
|
||||||
@@ -1,91 +0,0 @@
|
|||||||
import React from "react";
|
|
||||||
import Axios from "axios";
|
|
||||||
|
|
||||||
class usersService {
|
|
||||||
constructor() {
|
|
||||||
console.log("Er are here anyway");
|
|
||||||
}
|
|
||||||
|
|
||||||
logInUser(reqData) {
|
|
||||||
// debugger;
|
|
||||||
/*
|
|
||||||
clean up the request data here
|
|
||||||
*/
|
|
||||||
return this.postAuxEnd("/login", reqData);
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------- -----
|
|
||||||
//---------------------------------------- -----
|
|
||||||
// Unified call below
|
|
||||||
//---------------------------------------- -----
|
|
||||||
//---------------------------------------- -----
|
|
||||||
getAuxEnd(uri, reqData) {
|
|
||||||
const endPoint = process.env.REACT_APP_USERS_ENDPOINT + uri;
|
|
||||||
return Axios.get(endPoint)
|
|
||||||
.then((response) => {
|
|
||||||
// console.log(response);
|
|
||||||
// res = response;
|
|
||||||
// console.log("~~~~~~~ Toks2 GET ~~~~~~~~");
|
|
||||||
return response;
|
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
if (error.response) {
|
|
||||||
//response status is an error code
|
|
||||||
console.log(error.response.status);
|
|
||||||
} else if (error.request) {
|
|
||||||
//response not received though the request was sent
|
|
||||||
console.log(error.request);
|
|
||||||
} else {
|
|
||||||
//an error occurred when setting up the request
|
|
||||||
console.log(error.message);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
postAuxEnd(uri, reqData) {
|
|
||||||
const endPoint = process.env.REACT_APP_USERS_ENDPOINT + uri;
|
|
||||||
const token = '..your token..'
|
|
||||||
let axiosConfig = {
|
|
||||||
headers: {
|
|
||||||
'Accept': 'application/json',
|
|
||||||
'Access-Control-Allow-Origin': '*',
|
|
||||||
'Content-Type': 'application/json;charset=UTF-8',
|
|
||||||
'Authorization': `Basic ${token}`,
|
|
||||||
}
|
|
||||||
};
|
|
||||||
//Access-Control-Allow-Origin
|
|
||||||
var postData = {
|
|
||||||
email: "test@test.com",
|
|
||||||
password: "password"
|
|
||||||
};
|
|
||||||
// Axios.defaults.headers.post['Content-Type'] ='application/json;charset=utf-8';
|
|
||||||
// Axios.defaults.headers.post['Access-Control-Allow-Origin'] = '*'; //,axiosConfig
|
|
||||||
return Axios.post(endPoint, reqData)
|
|
||||||
.then((response) => {
|
|
||||||
console.log(response);
|
|
||||||
// res = response;
|
|
||||||
console.log("~~~~~~~ Toks2 POST ~~~~~~~~");
|
|
||||||
return response;
|
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
if (error.response) {
|
|
||||||
//response status is an error code
|
|
||||||
console.log("ERROR-------------------------------------------------------");
|
|
||||||
console.log(error.response.status);
|
|
||||||
console.log("ERROR-------------------------------------------------------");
|
|
||||||
} else if (error.request) {
|
|
||||||
//response not received though the request was sent
|
|
||||||
console.log("ERROR2-------------------------------------------------------");
|
|
||||||
console.log(error.request);
|
|
||||||
console.log("ERROR2-------------------------------------------------------");
|
|
||||||
} else {
|
|
||||||
//an error occurred when setting up the request
|
|
||||||
console.log("ERROR3-------------------------------------------------------");
|
|
||||||
console.log(error.message);
|
|
||||||
console.log("ERROR3-------------------------------------------------------");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export default usersService;
|
|
||||||
Reference in New Issue
Block a user