Commit 9716afe7 by Giang Tran

update code

parent 003c63ae
...@@ -18,7 +18,7 @@ import { ...@@ -18,7 +18,7 @@ import {
FORGOTPASSWORD, FORGOTPASSWORD,
CONFIRMEMAIL, CONFIRMEMAIL,
} from '../../routers/ScreenNames'; } from '../../routers/ScreenNames';
import {checkFormatArray} from '../../Config/Functions'; import {checkFormatArray, encryptRSAString} from '../../Config/Functions';
import {loginApi} from '../../apis/Functions/users'; import {loginApi} from '../../apis/Functions/users';
import KEY from '../../assets/AsynStorage'; import KEY from '../../assets/AsynStorage';
import AsyncStorage from '@react-native-community/async-storage'; import AsyncStorage from '@react-native-community/async-storage';
...@@ -75,12 +75,11 @@ const Login = (props) => { ...@@ -75,12 +75,11 @@ const Login = (props) => {
props.showLoading(); props.showLoading();
const res = await loginApi({ const res = await loginApi({
email, email,
password: pass, password: encryptRSAString(pass),
platform: Platform.OS, platform: Platform.OS,
device_token: firebase, device_token: firebase,
account_type: 'CUSTOMER', account_type: 'CUSTOMER',
}); });
props.hideLoading(); props.hideLoading();
if (res.data) { if (res.data) {
if (res.data.code == 200 && res.data.data) { if (res.data.code == 200 && res.data.data) {
......
...@@ -65,20 +65,10 @@ export async function PostLogin(url, json) { ...@@ -65,20 +65,10 @@ export async function PostLogin(url, json) {
console.log('post data mobile', myRequest); console.log('post data mobile', myRequest);
return await axios(myRequest) return await axios(myRequest)
.then((response) => { .then((response) => {
if (response.data?.code === 401) {
logout();
return;
} else {
return response; return response;
}
}) })
.then((response) => { .then((response) => {
if (response.data?.code === 401) {
logout();
return;
} else {
return response; return response;
}
}) })
.catch((error) => { .catch((error) => {
console.log(error); console.log(error);
......
export const root = 'http://services.dcvinvest.com/'; export const root = 'http://services.dcvinvest.com/';
export default { export default {
urllogin: root + 'api/auth/customer-login', urllogin: root + 'api/v2/auth/customer-login',
urlRegistor: root + 'api/auth/customer-register', urlRegistor: root + 'api/auth/customer-register',
urlGetListMethod: root + 'api/v1/payments/get-list-deposit-method', urlGetListMethod: root + 'api/v1/payments/get-list-deposit-method',
urlGetOTP: root + 'api/auth/customer-get-otp', urlGetOTP: root + 'api/auth/customer-get-otp',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment