add access token

This commit is contained in:
Nguyễn Hải Dũng
2022-12-20 10:49:41 +07:00
parent 11cec7054b
commit d87ed2c096
14 changed files with 45 additions and 9 deletions

View File

@@ -12,6 +12,7 @@ import swal from 'sweetalert';
import { useLocation } from 'react-router-dom';
import Switch from "react-switch";
import Select from "react-select";
import Store from '../../store';
import { useSelector } from 'react-redux';
const initialDataPost = {
@@ -86,7 +87,7 @@ export default function User() {
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
// 'Authorization': token,
'Authorization': Store.getState().isLogin.access_token,
},
})
if (result.data.status === 10000) {
@@ -137,7 +138,7 @@ export default function User() {
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
// 'Authorization': token
'Authorization': Store.getState().isLogin.access_token,
},
data: data ? data : dataPost,
})