working around on table
This commit is contained in:
parent
e6f5d152f0
commit
23fd193c34
36 changed files with 3999 additions and 82 deletions
|
|
@ -1,26 +0,0 @@
|
|||
import axios from 'axios'
|
||||
|
||||
const customAxios = axios.create({
|
||||
baseURL: import.meta.env.TAOBIN_RECIPE_MANAGER_SERVER_URL,
|
||||
withCredentials: true
|
||||
})
|
||||
|
||||
customAxios.interceptors.response.use(
|
||||
res => res,
|
||||
err => {
|
||||
const originalRequest = err.config
|
||||
|
||||
if (err.response.status === 401 && !originalRequest._retry) {
|
||||
originalRequest._retry = true
|
||||
return customAxios.get('/auth/refresh').then(res => {
|
||||
if (res.status === 200) {
|
||||
return customAxios(originalRequest)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
return Promise.reject(err)
|
||||
}
|
||||
)
|
||||
|
||||
export default customAxios
|
||||
Loading…
Add table
Add a link
Reference in a new issue