Commit 9716afe7 by Giang Tran

update code

parent 003c63ae
......@@ -18,7 +18,7 @@ import {
FORGOTPASSWORD,
CONFIRMEMAIL,
} from '../../routers/ScreenNames';
import {checkFormatArray} from '../../Config/Functions';
import {checkFormatArray, encryptRSAString} from '../../Config/Functions';
import {loginApi} from '../../apis/Functions/users';
import KEY from '../../assets/AsynStorage';
import AsyncStorage from '@react-native-community/async-storage';
......@@ -75,12 +75,11 @@ const Login = (props) => {
props.showLoading();
const res = await loginApi({
email,
password: pass,
password: encryptRSAString(pass),
platform: Platform.OS,
device_token: firebase,
account_type: 'CUSTOMER',
});
props.hideLoading();
if (res.data) {
if (res.data.code == 200 && res.data.data) {
......
......@@ -65,20 +65,10 @@ export async function PostLogin(url, json) {
console.log('post data mobile', myRequest);
return await axios(myRequest)
.then((response) => {
if (response.data?.code === 401) {
logout();
return;
} else {
return response;
}
})
.then((response) => {
if (response.data?.code === 401) {
logout();
return;
} else {
return response;
}
})
.catch((error) => {
console.log(error);
......
export const root = 'http://services.dcvinvest.com/';
export default {
urllogin: root + 'api/auth/customer-login',
urllogin: root + 'api/v2/auth/customer-login',
urlRegistor: root + 'api/auth/customer-register',
urlGetListMethod: root + 'api/v1/payments/get-list-deposit-method',
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