@hzab/data-model 1.1.0 → 1.1.1

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/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # @hzab/data-model@1.1.1
2
+
3
+ - fix: formData header 覆盖问题修复
4
+
1
5
  # @hzab/data-model@1.1.0
2
6
 
3
7
  - formData 问题修复
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hzab/data-model",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "data model",
5
5
  "main": "src",
6
6
  "scripts": {
package/src/data-model.js CHANGED
@@ -173,7 +173,7 @@ class DataModel {
173
173
  }
174
174
  const apiUrl = this.getApiUrl(this.createApi, _params, ctx, { from: "create" });
175
175
  if (params instanceof FormData) {
176
- opt.headers = { "Content-Type": "multipart/form-data" };
176
+ opt.headers = { ...(opt.headers ?? {}), "Content-Type": "multipart/form-data" };
177
177
  _params = objToFormData(_params);
178
178
  }
179
179
  this.axios
@@ -203,7 +203,7 @@ class DataModel {
203
203
  }
204
204
  const apiUrl = this.getApiUrl(this.updateApi, _params, ctx, { from: "update" });
205
205
  if (params instanceof FormData) {
206
- opt.headers = { "Content-Type": "multipart/form-data" };
206
+ opt.headers = { ...(opt.headers ?? {}), "Content-Type": "multipart/form-data" };
207
207
  _params = objToFormData(_params);
208
208
  }
209
209
  this.axios