@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.
- package/dist/lib/upload.js +11 -12
- package/package.json +1 -1
package/dist/lib/upload.js
CHANGED
|
@@ -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 =
|
|
64
|
-
_context.next =
|
|
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
|
|
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 =
|
|
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
|
|
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 =
|
|
92
|
+
_context.next = 28;
|
|
94
93
|
break;
|
|
95
|
-
case
|
|
96
|
-
_context.prev =
|
|
97
|
-
_context.t0 = _context["catch"](
|
|
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
|
|
109
|
+
case 28:
|
|
111
110
|
case "end":
|
|
112
111
|
return _context.stop();
|
|
113
112
|
}
|
|
114
|
-
}, _callee, null, [[
|
|
113
|
+
}, _callee, null, [[11, 23]]);
|
|
115
114
|
}));
|
|
116
115
|
return _customRequest.apply(this, arguments);
|
|
117
116
|
}
|