riku
2026-01-19 068be2757aa2d51e3f6604dae54287683160ad0e
service/baserequest.js
@@ -10,8 +10,8 @@
const util = require('../utils/util.js');
// 小程序后台
// const baseUrl = "http://192.168.0.138:8082"
const baseUrl = 'https://fyami.com.cn';
const baseUrl = "http://192.168.1.9:8082"
// const baseUrl = 'https://fyami.com.cn';
const bu = 'https://fyami.com.cn';
const basePicUrl = `${bu}/images/`;
const baseIconUrl = `${bu}/images/weixin/eplaw/`;
@@ -22,8 +22,8 @@
const spBu = "https://fyami.com.cn:447"
const spPicUrl = `${spBu}/images/`;
// const mode = 'debug';
const mode = 'prod';
const mode = 'debug';
// const mode = 'prod';
function request(fun, hostUrl) {
  const bUrl = hostUrl ? hostUrl : baseUrl;
@@ -44,12 +44,15 @@
    fun.url = bUrl + url;
  }
  var fun1 = util.deepCopy(fun);
  if (mode == 'debug') {
    console.log(
      '|------------------------------------------------------------------------------------------------------------',
    );
    console.log('|--访问: ', fun.url);
    console.log('|--参数: ', fun.data);
  }
  fun1.success = function (res) {
    if (mode == 'debug') {
      console.log(
        '|------------------------------------------------------------------------------------------------------------',
      );
      console.log('|--访问: ', fun.url);
      console.log('|--结果: ', res);
    }
@@ -73,8 +76,7 @@
  };
  fun1.fail = function (error) {
    if (mode == 'debug') {
      console.log('--------------请求错误----------------' + fun.url);
      console.log(error);
      console.log('|--错误: ', error);
    }
    wx.showToast({
      title: '请求失败',