From 2206df0da6499846c78a358cf95ca33c218a5c5d Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期三, 14 九月 2022 08:43:37 +0800
Subject: [PATCH] 2022.9.13
---
service/baserequest.js | 27 ++++++++++++++++++---------
1 files changed, 18 insertions(+), 9 deletions(-)
diff --git a/service/baserequest.js b/service/baserequest.js
index 21ed36a..687b48e 100644
--- a/service/baserequest.js
+++ b/service/baserequest.js
@@ -15,9 +15,10 @@
// 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,8 +30,8 @@
}
});
var url = fun.url
- fun.url = baseUrl + url + "?" + param
- }else{
+ fun.url = baseUrl + url + "?" + param
+ } else {
var url = fun.url
fun.url = baseUrl + url
}
@@ -38,7 +39,10 @@
fun1.success = function (res) {
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']
@@ -51,11 +55,15 @@
// }
}
fun1.fail = function (error) {
+ console.log("--------------璇锋眰閿欒----------------" + fun.url);
+ console.log(error);
wx.showToast({
title: '缃戠粶杩炴帴澶辫触',
icon: 'none'
})
- fun.fail(error)
+ if (fun.fail) {
+ fun.fail(error)
+ }
}
fun1.complete = fun.complete
wx.request(fun1)
@@ -70,7 +78,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