MrShi
2025-04-23 c8b32b8bca79a116cfab70eb8c389907b664c9ca
h5/utils/http.interceptor.js
@@ -1,3 +1,4 @@
import { decryptedData } from '@/utils/decryption.js'
const install = (Vue, vm) => {
   // 是否正在刷新的标记
   let isRefreshing = false
@@ -29,6 +30,7 @@
      if (response.data.code === 5112) {
         uni.showToast({
            title: '登录过期,正在重新跳转授权',
            icon: 'none',
            duration: 2000,
            success() {
               setTimeout(() => {
@@ -49,6 +51,17 @@
            duration: 2000
         });
      }
      if (response.data.message) {
         const tm = response.data.message
         const list = tm.split(' ')
         let msg = list[0]
         if (list.length > 1 && response.data.data) {
           msg = decryptedData(list[1], list[0])
           response.data.data = decryptedData(list[1], response.data.data)
           console.log(response.data.data)
           response.data.message = msg
         }
      }
      return response.data;
   }, (response) => {
      return Promise.reject(response)