@quansitech/antd-admin 1.1.34 → 1.1.35

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.
Files changed (2) hide show
  1. package/dist/lib/upload.js +11 -12
  2. package/package.json +1 -1
@@ -58,10 +58,9 @@ function _customRequest() {
58
58
  formData.append(key, policyRes.data.params[key]);
59
59
  }
60
60
  }
61
- formData.append('Content-Type', options.file.type);
62
61
  formData.append('file', options.file);
63
- _context.prev = 12;
64
- _context.next = 15;
62
+ _context.prev = 11;
63
+ _context.next = 14;
65
64
  return http({
66
65
  url: url,
67
66
  method: 'post',
@@ -76,25 +75,25 @@ function _customRequest() {
76
75
  });
77
76
  }
78
77
  });
79
- case 15:
78
+ case 14:
80
79
  res = _context.sent;
81
80
  err = res.data.info || res.data.err_msg;
82
81
  if (!err) {
83
- _context.next = 21;
82
+ _context.next = 20;
84
83
  break;
85
84
  }
86
85
  message.error(err);
87
86
  options.onError && options.onError(new Error(err), res.data);
88
87
  return _context.abrupt("return");
89
- case 21:
88
+ case 20:
90
89
  options.onSuccess && options.onSuccess(_objectSpread(_objectSpread({}, res.data), {}, {
91
90
  url: res.data.url || res.data.file_url
92
91
  }));
93
- _context.next = 29;
92
+ _context.next = 28;
94
93
  break;
95
- case 24:
96
- _context.prev = 24;
97
- _context.t0 = _context["catch"](12);
94
+ case 23:
95
+ _context.prev = 23;
96
+ _context.t0 = _context["catch"](11);
98
97
  if (_context.t0 instanceof AxiosError) {
99
98
  options.onError && options.onError(_context.t0, (_e$response = _context.t0.response) === null || _e$response === void 0 ? void 0 : _e$response.data);
100
99
  }
@@ -107,11 +106,11 @@ function _customRequest() {
107
106
  });
108
107
  }
109
108
  throw _context.t0;
110
- case 29:
109
+ case 28:
111
110
  case "end":
112
111
  return _context.stop();
113
112
  }
114
- }, _callee, null, [[12, 24]]);
113
+ }, _callee, null, [[11, 23]]);
115
114
  }));
116
115
  return _customRequest.apply(this, arguments);
117
116
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quansitech/antd-admin",
3
- "version": "1.1.34",
3
+ "version": "1.1.35",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"