React拦截器

aa​​​​​​​拦截器 - interceptors.request.use()请求拦截器,interceptors.response.use()响应拦截器 - axios 网络请求库

axios.interceptors.request.use(function(config){
	//比如是否需要设置 token
	config.headers.token='wwwwwsdsdf'
	return config
})

posted @ 2022-07-17 12:12  小大宇  阅读(63)  评论(0)    收藏  举报