gaoluyang
2025-11-17 c46bf7475742e9b50a8fdcc8d592ba3a86b2754d
src/utils/request.ts
@@ -21,6 +21,13 @@
    url = url.slice(0, -1)
    config.url = url
  }
  // 记录请求参数
  // console.log('请求发送参数:', {
  //   url: (config.baseUrl || baseUrl) + config.url,
  //   method: config.method || 'GET',
  //   headers: config.header,
  //   data: config.data
  // })
  return new Promise((resolve, reject) => {
    uni.request({
      method: config.method || 'GET',
@@ -41,6 +48,12 @@
      const code = data.code || 200
      // @ts-ignore
      const msg: string = errorCode[code] || data.msg || errorCode['default']
      // 记录接收到的参数
      // console.log('接收到的参数:', {
      //   url: (config.baseUrl || baseUrl) + config.url,
      //   code: code,
      //   data: data
      // })
      if (code === 401) {
        showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => {
          if (res.confirm) {