ps-toolkit-ui 1.16.96 → 1.16.97
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/ps-toolkit-ui.umd.js +21 -10
- package/bundles/ps-toolkit-ui.umd.js.map +1 -1
- package/bundles/ps-toolkit-ui.umd.min.js +1 -1
- package/bundles/ps-toolkit-ui.umd.min.js.map +1 -1
- package/esm2015/lib/classes/request.class.js +22 -11
- package/fesm2015/ps-toolkit-ui.js +21 -10
- package/fesm2015/ps-toolkit-ui.js.map +1 -1
- package/package.json +1 -1
|
@@ -2108,17 +2108,28 @@
|
|
|
2108
2108
|
RequestClass.prototype.getClient = function (url, method, data, done, fail) {
|
|
2109
2109
|
var _this = this;
|
|
2110
2110
|
var token = HelperClass.getCookie('Authorization');
|
|
2111
|
-
|
|
2112
|
-
|
|
2111
|
+
var settings;
|
|
2112
|
+
if (data instanceof FormData) {
|
|
2113
|
+
settings = {
|
|
2114
|
+
url: this.environment.apiUrl + url,
|
|
2115
|
+
method: exports.Method[method].toString(),
|
|
2116
|
+
processData: false,
|
|
2117
|
+
contentType: false,
|
|
2118
|
+
data: data,
|
|
2119
|
+
headers: token == null ? {} : { Authorization: token }
|
|
2120
|
+
};
|
|
2121
|
+
}
|
|
2122
|
+
else {
|
|
2123
|
+
// TODO const formData = this.jsonToFormData(data);
|
|
2124
|
+
settings = {
|
|
2125
|
+
url: this.environment.apiUrl + url,
|
|
2126
|
+
method: exports.Method[method].toString(),
|
|
2127
|
+
dataType: 'json',
|
|
2128
|
+
contentType: 'application/json; charset=utf-8',
|
|
2129
|
+
data: data !== null && data !== {} ? JSON.stringify(data, null, 2) : null,
|
|
2130
|
+
headers: token == null ? {} : { Authorization: token, Accept: 'application/json' }
|
|
2131
|
+
};
|
|
2113
2132
|
}
|
|
2114
|
-
var settings = {
|
|
2115
|
-
url: this.environment.apiUrl + url,
|
|
2116
|
-
method: exports.Method[method].toString(),
|
|
2117
|
-
processData: false,
|
|
2118
|
-
contentType: false,
|
|
2119
|
-
data: data,
|
|
2120
|
-
headers: token == null ? {} : { Authorization: token }
|
|
2121
|
-
};
|
|
2122
2133
|
var request = $$1.ajax(settings);
|
|
2123
2134
|
request.done(function (response) {
|
|
2124
2135
|
if (!_this.environment.production) {
|