small-program/utils/http.interceptor.js
@@ -2,6 +2,7 @@ // 请求拦截器 uni.$u.http.interceptors.request.use((config) => { const Headtoken = vm.$store.state.token uni.showLoading({ title: '加载中' }); // 判断有无token,有则加入请求头中 if (Headtoken) { config.header['token'] = Headtoken; @@ -13,6 +14,7 @@ // 响应拦截器 uni.$u.http.interceptors.response.use((response) => { uni.hideLoading(); // console.log(response.data) if (response.data.code === 5113) { uni.switchTab({