jiangping
2023-10-26 ea87c908fb6cdfc3e227a584a53e6730efb8262a
minipro_standard/util/request/responseInterceptors.js
@@ -6,15 +6,15 @@
   uni.$u.http.interceptors.response.use((response) => {
      uni.hideLoading();
      const data = response.data
      if (data.code === 401) {     // 处理登录过期
      if (response.data.code === 401) {     // 处理登录过期
         uni.showToast({ title: '登录过期,准备自动重新登录', icon: 'none', duration: 2000, mask: true });
         setTimeout(() => {
            uni.reLaunch({ url: '/pages/login/login' });
         }, 2000)
         return
      }
      if (data.code !== 200) {     // 请求报错
         uni.showToast({ title: data.message, icon: 'none', duration: 2000 });
      if (response.data.code !== 200) {     // 请求报错
         uni.showToast({ title: response.data.message, icon: 'none', duration: 2000 });
      }
      return data || {}
   }, (error) => {