|
@@ -42,14 +42,12 @@ export default {
|
|
|
async onSubmit({ data }) {
|
|
|
if (this.id) {
|
|
|
let res = await this.update(data);
|
|
|
- if (this.$checkRes(res)) {
|
|
|
- this.$toast({ type: `success`, message: `操作成功` });
|
|
|
+ if (this.$checkRes(res, `操作成功`, `${res.errmsg}`)) {
|
|
|
this.back();
|
|
|
}
|
|
|
} else {
|
|
|
let res = await this.create(data);
|
|
|
- if (this.$checkRes(res)) {
|
|
|
- this.$toast({ type: `success`, message: `操作成功` });
|
|
|
+ if (this.$checkRes(res, `操作成功`, `${res.errmsg}`)) {
|
|
|
this.back();
|
|
|
}
|
|
|
}
|