Skip to content

Commit

Permalink
publish 0.3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
lizong9527 committed Nov 30, 2022
1 parent fa82f1d commit 114ea59
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 17 deletions.
9 changes: 5 additions & 4 deletions dist/index.aio.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* axios-miniprogram-adapter 0.3.4 (https://github.com/bigMeow/axios-miniprogram-adapter)
* axios-miniprogram-adapter 0.3.5 (https://github.com/bigMeow/axios-miniprogram-adapter)
* API https://github.com/bigMeow/axios-miniprogram-adapter/blob/master/doc/api.md
* Copyright 2018-2022 bigMeow. All Rights Reserved
* Licensed under MIT (https://github.com/bigMeow/axios-miniprogram-adapter/blob/master/LICENSE)
Expand Down Expand Up @@ -151,7 +151,7 @@
if (["alipay" /* 支付宝 */, "dd" /* 钉钉 */].includes(platFormName)) {
config.headers = config.header;
delete config.header;
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]') {
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]') {
// Content-Type为application/json时,data参数只支持json字符串,需要手动调用JSON.stringify进行序列化
config.data = JSON.stringify(config.data);
}
Expand All @@ -167,7 +167,8 @@
return false;
}
};
function mpAdapter(config) {
function mpAdapter(config, _a) {
var _b = (_a === void 0 ? {} : _a).transformRequestOption, transformRequestOption = _b === void 0 ? function (requestOption) { return requestOption; } : _b;
var request = getRequest();
return new Promise(function (resolve, reject) {
var requestTask;
Expand Down Expand Up @@ -231,7 +232,7 @@
if (requestData !== undefined) {
mpRequestOption.data = requestData;
}
requestTask = request(transformConfig(mpRequestOption));
requestTask = request(transformRequestOption(transformConfig(mpRequestOption)));
});
}

Expand Down
9 changes: 5 additions & 4 deletions dist/index.esm.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* axios-miniprogram-adapter 0.3.4 (https://github.com/bigMeow/axios-miniprogram-adapter)
* axios-miniprogram-adapter 0.3.5 (https://github.com/bigMeow/axios-miniprogram-adapter)
* API https://github.com/bigMeow/axios-miniprogram-adapter/blob/master/doc/api.md
* Copyright 2018-2022 bigMeow. All Rights Reserved
* Licensed under MIT (https://github.com/bigMeow/axios-miniprogram-adapter/blob/master/LICENSE)
Expand Down Expand Up @@ -145,7 +145,7 @@ function transformConfig(config) {
if (["alipay" /* 支付宝 */, "dd" /* 钉钉 */].includes(platFormName)) {
config.headers = config.header;
delete config.header;
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]') {
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]') {
// Content-Type为application/json时,data参数只支持json字符串,需要手动调用JSON.stringify进行序列化
config.data = JSON.stringify(config.data);
}
Expand All @@ -161,7 +161,8 @@ var isJSONstr = function (str) {
return false;
}
};
function mpAdapter(config) {
function mpAdapter(config, _a) {
var _b = (_a === void 0 ? {} : _a).transformRequestOption, transformRequestOption = _b === void 0 ? function (requestOption) { return requestOption; } : _b;
var request = getRequest();
return new Promise(function (resolve, reject) {
var requestTask;
Expand Down Expand Up @@ -225,7 +226,7 @@ function mpAdapter(config) {
if (requestData !== undefined) {
mpRequestOption.data = requestData;
}
requestTask = request(transformConfig(mpRequestOption));
requestTask = request(transformRequestOption(transformConfig(mpRequestOption)));
});
}

Expand Down
9 changes: 5 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* axios-miniprogram-adapter 0.3.4 (https://github.com/bigMeow/axios-miniprogram-adapter)
* axios-miniprogram-adapter 0.3.5 (https://github.com/bigMeow/axios-miniprogram-adapter)
* API https://github.com/bigMeow/axios-miniprogram-adapter/blob/master/doc/api.md
* Copyright 2018-2022 bigMeow. All Rights Reserved
* Licensed under MIT (https://github.com/bigMeow/axios-miniprogram-adapter/blob/master/LICENSE)
Expand Down Expand Up @@ -149,7 +149,7 @@ function transformConfig(config) {
if (["alipay" /* 支付宝 */, "dd" /* 钉钉 */].includes(platFormName)) {
config.headers = config.header;
delete config.header;
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]') {
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]') {
// Content-Type为application/json时,data参数只支持json字符串,需要手动调用JSON.stringify进行序列化
config.data = JSON.stringify(config.data);
}
Expand All @@ -165,7 +165,8 @@ var isJSONstr = function (str) {
return false;
}
};
function mpAdapter(config) {
function mpAdapter(config, _a) {
var _b = (_a === void 0 ? {} : _a).transformRequestOption, transformRequestOption = _b === void 0 ? function (requestOption) { return requestOption; } : _b;
var request = getRequest();
return new Promise(function (resolve, reject) {
var requestTask;
Expand Down Expand Up @@ -229,7 +230,7 @@ function mpAdapter(config) {
if (requestData !== undefined) {
mpRequestOption.data = requestData;
}
requestTask = request(transformConfig(mpRequestOption));
requestTask = request(transformRequestOption(transformConfig(mpRequestOption)));
});
}

Expand Down
9 changes: 5 additions & 4 deletions dist/miniprogram/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* axios-miniprogram-adapter 0.3.4 (https://github.com/bigMeow/axios-miniprogram-adapter)
* axios-miniprogram-adapter 0.3.5 (https://github.com/bigMeow/axios-miniprogram-adapter)
* API https://github.com/bigMeow/axios-miniprogram-adapter/blob/master/doc/api.md
* Copyright 2018-2022 bigMeow. All Rights Reserved
* Licensed under MIT (https://github.com/bigMeow/axios-miniprogram-adapter/blob/master/LICENSE)
Expand Down Expand Up @@ -680,7 +680,7 @@ function transformConfig(config) {
if (["alipay" /* 支付宝 */, "dd" /* 钉钉 */].includes(platFormName)) {
config.headers = config.header;
delete config.header;
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]') {
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]') {
// Content-Type为application/json时,data参数只支持json字符串,需要手动调用JSON.stringify进行序列化
config.data = JSON.stringify(config.data);
}
Expand All @@ -696,7 +696,8 @@ var isJSONstr = function (str) {
return false;
}
};
function mpAdapter(config) {
function mpAdapter(config, _a) {
var _b = (_a === void 0 ? {} : _a).transformRequestOption, transformRequestOption = _b === void 0 ? function (requestOption) { return requestOption; } : _b;
var request = getRequest();
return new Promise(function (resolve, reject) {
var requestTask;
Expand Down Expand Up @@ -760,7 +761,7 @@ function mpAdapter(config) {
if (requestData !== undefined) {
mpRequestOption.data = requestData;
}
requestTask = request(transformConfig(mpRequestOption));
requestTask = request(transformRequestOption(transformConfig(mpRequestOption)));
});
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "axios-miniprogram-adapter",
"version": "0.3.4",
"version": "0.3.5",
"description": "Axios adapter for miniprogram",
"main": "dist/index.js",
"jsnext:main": "dist/index.esm.js",
Expand Down

0 comments on commit 114ea59

Please sign in to comment.