首页
mac
it
登录
6mi
u
盘
搜
搜 索
it
axios拦截器
axios拦截器
mac
2022-06-30
11
axios
.interceptors
.request
.
use
(
function
(config
)
{
// 在发送请求之前做些什么
return config
;
}
,
function
(error
)
{
// 对请求错误做些什么
return Promise
.
reject
(error
)
;
}
)
;
// 添加响应拦截器 axios
.interceptors
.response
.
use
(
function
(response
)
{
// 对响应数据做点什么
return response
;
}
,
function
(error
)
{
// 对响应错误做点什么
return Promise
.
reject
(error
)
;
}
)
;
转载于:https://www.cnblogs.com/xiannv/p/11203532.html
转载请注明原文地址: https://mac.8miu.com/read-37425.html
最新回复
(
0
)