10 lines
221 B
JavaScript
10 lines
221 B
JavaScript
import axios from "axios";
|
|
|
|
export default (token = null) => {
|
|
if (token) {
|
|
axios.defaults.headers.common.authorization = `Bearer ${token}`;
|
|
} else {
|
|
delete axios.defaults.headers.common.authorization;
|
|
}
|
|
};
|