| | |
| | | axios.interceptors.request.use(config => { |
| | | let token = store.getters.token |
| | | if(token) { |
| | | config.headers['Authorization'] = token |
| | | config.headers['token'] = token |
| | | } |
| | | return config |
| | | },error => { |
| | |
| | | }) |
| | | |
| | | axios.interceptors.response.use(config => { |
| | | // console.log(config,'config---config') |
| | | const status = Number(config.status) |
| | | const message = config.data.error |
| | | if( status !== 200) { |
| | |
| | | } |
| | | return config |
| | | },(error) => { |
| | | console.log(error,'error') |
| | | // console.log(error,'error') |
| | | const { status, data } = error.response |
| | | const { error : message } = data |
| | | if(status === 503) { |