axiosでトークン取得を修正する
This commit is contained in:
@@ -16,7 +16,7 @@ declare module '@vue/runtime-core' {
|
||||
// "export default () => {}" function below (which runs individually
|
||||
// for each client)
|
||||
const api:AxiosInstance = axios.create({ baseURL: process.env.KAB_BACKEND_URL });
|
||||
const token=localStorage.getItem('token')||'';
|
||||
const token=JSON.parse(localStorage.getItem('auth') ?? '{}')?.token||'';
|
||||
if(token!==''){
|
||||
api.defaults.headers["Authorization"]='Bearer ' + token;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user