ll
liukangdong
2025-03-05 7c60a229899757aaae09f0152bd0a8a78dfeaf2a
h5/utils/service.js
@@ -1,4 +1,4 @@
import { baseUrl } from "./config.js"
import { baseUrl, app_url } from "./config.js"
export const http = function (options) {
   {
      return new Promise((resolve, reject) => {
@@ -33,13 +33,16 @@
                        icon: "none",
                        duration: 2000
                     })
                  })
                  if (data.code === 500 || data.code === 5112) {
                     uni.clearStorageSync()
                     return uni.navigateTo({
                        url: '/pages/login/login'
                  },500)
                  if (data.code === 500) {
                     uni.showToast({
                        'title': '服务器异常',icon:'none'
                     })
                  }
                  if (data.code === 5112) {
                     uni.clearStorageSync()
                     window.location.href = app_url
                  }
                  return resolve(data)
               }
               resolve(data)