From 437144f41c74505d362a5214a18cec3d01b3ce4b Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期一, 10 十月 2022 17:51:30 +0800
Subject: [PATCH] 2022.10.10

---
 service/baserequest.js |   38 +++++++++++++++++++++++---------------
 1 files changed, 23 insertions(+), 15 deletions(-)

diff --git a/service/baserequest.js b/service/baserequest.js
index b924990..c725821 100644
--- a/service/baserequest.js
+++ b/service/baserequest.js
@@ -7,17 +7,19 @@
  * 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.0.117:8080"
-// const baseUrl = "https://fyami.com.cn:447"
+// const baseUrl = "http://192.168.1.106:8080"
+const baseUrl = "https://fyami.com.cn:447"
 // const basePicUrl = baseUrl + "/images/"
 const basePicUrl = "https://fyami.com.cn:447/images/"
-const baseFileUrl = baseUrl + "/meeting/file/"
+const baseIconUrl = "https://fyami.com.cn:447/images/weixin/eplaw/"
+const baseFileUrl = "https://fyami.com.cn:447/meeting/file/"
 
-function request(fun) { 
+function request(fun) {
   if (fun.params != undefined) {
     var param = ""
     Object.keys(fun.params).forEach(key => {
@@ -29,16 +31,20 @@
       }
     });
     var url = fun.url
-    fun.url = baseUrl + url + "?" + param 
-  }else{
+    fun.url = baseUrl + url + "?" + param
+  } else {
     var url = fun.url
     fun.url = baseUrl + url
   }
   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)
+    }
     fun.success(res.data)
     // if(res.data.success) {
     //   var head = res.data['head']
@@ -54,11 +60,12 @@
     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)      
+      fun.fail(error)
     }
   }
   fun1.complete = fun.complete
@@ -74,7 +81,8 @@
     fun['method'] = 'POST'
     request(fun)
   },
-  basePicUrl:basePicUrl,
-  baseUrl:baseUrl,
-  baseFileUrl:baseFileUrl
+  basePicUrl: basePicUrl,
+  baseUrl: baseUrl,
+  baseFileUrl: baseFileUrl,
+  baseIconUrl: baseIconUrl
 }
\ No newline at end of file

--
Gitblit v1.9.3