Former-commit-id: 2b8e28e5f5348877107060e4092123f21db1ef94
master
wangbing 5 years ago
parent 17fcfa5350
commit dc677002db

@ -143,8 +143,16 @@
utils.blobtoDown(decodeURIComponent(fileName), new Blob([response.data])) utils.blobtoDown(decodeURIComponent(fileName), new Blob([response.data]))
return Promise.resolve({errors: []}); return Promise.resolve({errors: []});
} }
}, function (response) { }, function (error) {
return Promise.resolve(handleError(response.response.status)); nav.tipClose();
nav.barError();
const rsp = {errors: []};
if (!error.response) {
rsp.errors.push({message: error.message});
} else {
rsp.errors.push(handleError(error.response.status));
}
return Promise.resolve(rsp);
}) })
}; };
function Ajax(module, target, method) { function Ajax(module, target, method) {
@ -261,8 +269,11 @@
.module(this.module) .module(this.module)
.target(this.target) .target(this.target)
.method("template") .method("template")
.data({}) .template(function (response) {
.template() if (response.errors.length > 0) {
nav.e(response.errors[0].message);
}
})
}, },
onImport: function (item) { onImport: function (item) {
utils.selectFile(function (files) { utils.selectFile(function (files) {
@ -270,7 +281,11 @@
.module(this.module) .module(this.module)
.target(this.target) .target(this.target)
.data(files[0]) .data(files[0])
.imports(); .imports(function (response) {
if (response.errors.length > 0) {
nav.e(response.errors[0].message);
}
});
}.bind(this)) }.bind(this))
}, },
onExport: function () { onExport: function () {
@ -278,7 +293,11 @@
.module(this.module) .module(this.module)
.target(this.target) .target(this.target)
.data( this.vm) .data( this.vm)
.exports(); .exports(function (response) {
if (response.errors.length > 0) {
nav.e(response.errors[0].message);
}
});
}, },
onSave: function () { onSave: function () {
this.$refs['form'].validate(function (valid) { this.$refs['form'].validate(function (valid) {

Loading…
Cancel
Save

Powered by TurnKey Linux.