1
1
/*!
2
- * axios-miniprogram-adapter 0.3.4 (https://github.com/bigMeow/axios-miniprogram-adapter)
2
+ * axios-miniprogram-adapter 0.3.5 (https://github.com/bigMeow/axios-miniprogram-adapter)
3
3
* API https://github.com/bigMeow/axios-miniprogram-adapter/blob/master/doc/api.md
4
4
* Copyright 2018-2022 bigMeow. All Rights Reserved
5
5
* Licensed under MIT (https://github.com/bigMeow/axios-miniprogram-adapter/blob/master/LICENSE)
@@ -145,7 +145,7 @@ function transformConfig(config) {
145
145
if ( [ "alipay" /* 支付宝 */ , "dd" /* 钉钉 */ ] . includes ( platFormName ) ) {
146
146
config . headers = config . header ;
147
147
delete config . header ;
148
- if ( "dd" /* 钉钉 */ === platFormName && config . method !== " GET" && ( ( _a = config . headers ) === null || _a === void 0 ? void 0 : _a [ 'Content-Type' ] ) === 'application/json' && Object . prototype . toString . call ( config . data ) === '[object Object]' ) {
148
+ if ( "dd" /* 钉钉 */ === platFormName && config . method !== ' GET' && ( ( _a = config . headers ) === null || _a === void 0 ? void 0 : _a [ 'Content-Type' ] ) === 'application/json' && Object . prototype . toString . call ( config . data ) === '[object Object]' ) {
149
149
// Content-Type为application/json时,data参数只支持json字符串,需要手动调用JSON.stringify进行序列化
150
150
config . data = JSON . stringify ( config . data ) ;
151
151
}
@@ -161,7 +161,8 @@ var isJSONstr = function (str) {
161
161
return false ;
162
162
}
163
163
} ;
164
- function mpAdapter ( config ) {
164
+ function mpAdapter ( config , _a ) {
165
+ var _b = ( _a === void 0 ? { } : _a ) . transformRequestOption , transformRequestOption = _b === void 0 ? function ( requestOption ) { return requestOption ; } : _b ;
165
166
var request = getRequest ( ) ;
166
167
return new Promise ( function ( resolve , reject ) {
167
168
var requestTask ;
@@ -225,7 +226,7 @@ function mpAdapter(config) {
225
226
if ( requestData !== undefined ) {
226
227
mpRequestOption . data = requestData ;
227
228
}
228
- requestTask = request ( transformConfig ( mpRequestOption ) ) ;
229
+ requestTask = request ( transformRequestOption ( transformConfig ( mpRequestOption ) ) ) ;
229
230
} ) ;
230
231
}
231
232
0 commit comments