@hzab/data-model 1.4.0 → 1.4.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 +4 -0
- package/package.json +1 -1
- package/src/data-model.js +7 -3
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
package/src/data-model.js
CHANGED
|
@@ -405,17 +405,21 @@ class DataModel {
|
|
|
405
405
|
|
|
406
406
|
handleMsg(
|
|
407
407
|
response,
|
|
408
|
-
{
|
|
408
|
+
opt = {
|
|
409
409
|
// 是否使用 response.statusText 作为兜底 msg
|
|
410
|
-
useStatusText,
|
|
410
|
+
useStatusText: false,
|
|
411
411
|
},
|
|
412
412
|
) {
|
|
413
|
+
const {
|
|
414
|
+
// 是否使用 response.statusText 作为兜底 msg
|
|
415
|
+
useStatusText,
|
|
416
|
+
} = opt || {};
|
|
413
417
|
let message =
|
|
414
418
|
(response.data && (response.data.message || response.data.msg)) ||
|
|
415
419
|
response.msg ||
|
|
416
420
|
this.getNetworkErrMsg(response);
|
|
417
421
|
|
|
418
|
-
if (useStatusText) {
|
|
422
|
+
if (!message && useStatusText) {
|
|
419
423
|
message = response.statusText;
|
|
420
424
|
}
|
|
421
425
|
|