Skip to content

Commit 114ea59

Browse files
committed
publish 0.3.5
1 parent fa82f1d commit 114ea59

File tree

5 files changed

+21
-17
lines changed

5 files changed

+21
-17
lines changed

dist/index.aio.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
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)
@@ -151,7 +151,7 @@
151151
if (["alipay" /* 支付宝 */, "dd" /* 钉钉 */].includes(platFormName)) {
152152
config.headers = config.header;
153153
delete config.header;
154-
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]') {
154+
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]') {
155155
// Content-Type为application/json时,data参数只支持json字符串,需要手动调用JSON.stringify进行序列化
156156
config.data = JSON.stringify(config.data);
157157
}
@@ -167,7 +167,8 @@
167167
return false;
168168
}
169169
};
170-
function mpAdapter(config) {
170+
function mpAdapter(config, _a) {
171+
var _b = (_a === void 0 ? {} : _a).transformRequestOption, transformRequestOption = _b === void 0 ? function (requestOption) { return requestOption; } : _b;
171172
var request = getRequest();
172173
return new Promise(function (resolve, reject) {
173174
var requestTask;
@@ -231,7 +232,7 @@
231232
if (requestData !== undefined) {
232233
mpRequestOption.data = requestData;
233234
}
234-
requestTask = request(transformConfig(mpRequestOption));
235+
requestTask = request(transformRequestOption(transformConfig(mpRequestOption)));
235236
});
236237
}
237238

dist/index.esm.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
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

dist/index.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
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)
@@ -149,7 +149,7 @@ function transformConfig(config) {
149149
if (["alipay" /* 支付宝 */, "dd" /* 钉钉 */].includes(platFormName)) {
150150
config.headers = config.header;
151151
delete config.header;
152-
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]') {
152+
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]') {
153153
// Content-Type为application/json时,data参数只支持json字符串,需要手动调用JSON.stringify进行序列化
154154
config.data = JSON.stringify(config.data);
155155
}
@@ -165,7 +165,8 @@ var isJSONstr = function (str) {
165165
return false;
166166
}
167167
};
168-
function mpAdapter(config) {
168+
function mpAdapter(config, _a) {
169+
var _b = (_a === void 0 ? {} : _a).transformRequestOption, transformRequestOption = _b === void 0 ? function (requestOption) { return requestOption; } : _b;
169170
var request = getRequest();
170171
return new Promise(function (resolve, reject) {
171172
var requestTask;
@@ -229,7 +230,7 @@ function mpAdapter(config) {
229230
if (requestData !== undefined) {
230231
mpRequestOption.data = requestData;
231232
}
232-
requestTask = request(transformConfig(mpRequestOption));
233+
requestTask = request(transformRequestOption(transformConfig(mpRequestOption)));
233234
});
234235
}
235236

dist/miniprogram/index.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
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)
@@ -680,7 +680,7 @@ function transformConfig(config) {
680680
if (["alipay" /* 支付宝 */, "dd" /* 钉钉 */].includes(platFormName)) {
681681
config.headers = config.header;
682682
delete config.header;
683-
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]') {
683+
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]') {
684684
// Content-Type为application/json时,data参数只支持json字符串,需要手动调用JSON.stringify进行序列化
685685
config.data = JSON.stringify(config.data);
686686
}
@@ -696,7 +696,8 @@ var isJSONstr = function (str) {
696696
return false;
697697
}
698698
};
699-
function mpAdapter(config) {
699+
function mpAdapter(config, _a) {
700+
var _b = (_a === void 0 ? {} : _a).transformRequestOption, transformRequestOption = _b === void 0 ? function (requestOption) { return requestOption; } : _b;
700701
var request = getRequest();
701702
return new Promise(function (resolve, reject) {
702703
var requestTask;
@@ -760,7 +761,7 @@ function mpAdapter(config) {
760761
if (requestData !== undefined) {
761762
mpRequestOption.data = requestData;
762763
}
763-
requestTask = request(transformConfig(mpRequestOption));
764+
requestTask = request(transformRequestOption(transformConfig(mpRequestOption)));
764765
});
765766
}
766767

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "axios-miniprogram-adapter",
3-
"version": "0.3.4",
3+
"version": "0.3.5",
44
"description": "Axios adapter for miniprogram",
55
"main": "dist/index.js",
66
"jsnext:main": "dist/index.esm.js",

0 commit comments

Comments
 (0)