update call
This commit is contained in:
@@ -33,8 +33,13 @@ export default function Login() {
|
|||||||
const userApi = new usersService();
|
const userApi = new usersService();
|
||||||
const doLogin = () => {
|
const doLogin = () => {
|
||||||
if (email !== "" && password !== "") {
|
if (email !== "" && password !== "") {
|
||||||
userApi.logInUser("support@mermsemr.com"); // just for a test
|
var postData = {
|
||||||
if (email === "support@mermsemr.com") {
|
username: email,
|
||||||
|
password: password
|
||||||
|
};
|
||||||
|
const loginResult = 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(() => {
|
||||||
|
|||||||
@@ -60,7 +60,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, postData)
|
return Axios.post(endPoint, reqData)
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
console.log(response);
|
console.log(response);
|
||||||
// res = response;
|
// res = response;
|
||||||
|
|||||||
Reference in New Issue
Block a user