#
zhou zhou
7 小时以前 3f6db669d6fbe48d8260d9c0032e6774b79c78c0
config/request.js
@@ -25,6 +25,18 @@
      // 初始化请求拦截器时,会执行此方法,此时data为undefined,赋予默认{}
      config.data = config.data || {}
      // 动态获取设置,支持在运行时修改 app_settings 无需重启
      let settings = uni.getStorageSync('app_settings');
      if (!settings) {
         settings = {
            ip: '127.0.0.1',
            port: '8080',
            project: 'wms'
         };
      }
      // 重写拦截器的 baseURL,每次请求都生效
      config.baseURL = `http://${settings.ip}:${settings.port}/${settings.project}`;
      // 提示加载框逻辑(根据 custom.hideLoading 决定)
      const hideLoading = config.custom?.hideLoading;
      if (hideLoading === false || hideLoading === undefined) {