riku
2022-10-12 741d1f7b2e2ac1c3f89d80dfac7625e3427e2367
service/baserequest.js
@@ -7,11 +7,11 @@
 * fail: function(error)
 * } 
 */
const { duration } = require("../utils/moment.min.js");
const util = require("../utils/util.js")
const originProperties = ['url', 'data', 'header', 'method', 'success', 'fail', 'complete'];
// const baseUrl = "http://127.0.0.1:8080"
// const baseUrl = "http://192.168.1.106:8080"
// const baseUrl = "http://192.168.0.137:8080"
const baseUrl = "https://fyami.com.cn:447"
// const basePicUrl = baseUrl + "/images/"
const basePicUrl = "https://fyami.com.cn:447/images/"
@@ -37,8 +37,9 @@
  }
  var fun1 = util.deepCopy(fun)
  fun1.success = function (res) {
    console.log("--------------请求结果----------------" + fun.url);
    console.log(res);
    console.log("|------------------------------------------------------------------------------------------------------------");
    console.log("|--访问: ", fun.url);
    console.log("|--结果: ", res);
    if (fun.onHead) {
      fun.onHead(res.header)
@@ -58,8 +59,9 @@
    console.log("--------------请求错误----------------" + fun.url);
    console.log(error);
    wx.showToast({
      title: '网络连接失败',
      icon: 'none'
      title: error.errMsg,
      icon: 'none',
      duration: 2000
    })
    if (fun.fail) {
      fun.fail(error)