11/*!
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)
33 * API https://github.com/bigMeow/axios-miniprogram-adapter/blob/master/doc/api.md
44 * Copyright 2018-2022 bigMeow. All Rights Reserved
55 * Licensed under MIT (https://github.com/bigMeow/axios-miniprogram-adapter/blob/master/LICENSE)
@@ -145,7 +145,7 @@ function transformConfig(config) {
145145 if ( [ "alipay" /* 支付宝 */ , "dd" /* 钉钉 */ ] . includes ( platFormName ) ) {
146146 config . headers = config . header ;
147147 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]' ) {
149149 // Content-Type为application/json时,data参数只支持json字符串,需要手动调用JSON.stringify进行序列化
150150 config . data = JSON . stringify ( config . data ) ;
151151 }
@@ -161,7 +161,8 @@ var isJSONstr = function (str) {
161161 return false ;
162162 }
163163} ;
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 ;
165166 var request = getRequest ( ) ;
166167 return new Promise ( function ( resolve , reject ) {
167168 var requestTask ;
@@ -225,7 +226,7 @@ function mpAdapter(config) {
225226 if ( requestData !== undefined ) {
226227 mpRequestOption . data = requestData ;
227228 }
228- requestTask = request ( transformConfig ( mpRequestOption ) ) ;
229+ requestTask = request ( transformRequestOption ( transformConfig ( mpRequestOption ) ) ) ;
229230 } ) ;
230231}
231232
0 commit comments