Houjie
2025-05-15 1833dd6d7cac01c35840af52fadc1199821e5805
common/service/service.js
@@ -70,26 +70,32 @@
          tip.error('拒绝访问');
          break
        case 500:
          if(!token || data.message=="Token失效,请重新登录"){
            let timeout=setTimeout(tip.alert('登录已过期'), 1000);
            store.dispatch('Logout').then(() => {
            clearTimeout(timeout)
                window.location.reload()
            })
          }
      this.$tip.alert('服务器遇到一个错误,暂时无法处理您的请求');
    //       if(!token || data.message=="Token失效,请重新登录"){
    //         let timeout=setTimeout(tip.alert('登录已过期'), 1000);
    //         store.dispatch('Logout').then(() => {
            // clearTimeout(timeout)
    //             window.location.reload()
    //         })
    //       }
          break
        case 404:
          break
        case 504:
         break
        case 401:
          if (token) {
           /* store.dispatch('Logout').then(() => {
              setTimeout(() => {
                window.location.reload()
              }, 1500)
            }) */
          }
          uni.showModal({
             title: '提示',
             content: '登录超时,需要重新登录!',
             showCancel:false,
             success: (res)=> {
                if (res.confirm) {
                   uni.reLaunch({
                      url: '/pages/login/login'
                   })
                }
             }
          });
          break
        default:
          tip.error({