Commit ca27ca0e authored by jiaorz's avatar jiaorz

rgh

parent cd4bf5cf
...@@ -464,15 +464,27 @@ ...@@ -464,15 +464,27 @@
set[formName].validate(valid => { set[formName].validate(valid => {
if (valid) { if (valid) {
addObj(this.form) addObj(this.form)
.then(() => { .then(response => {
console.log(response)
if(response.status == 200) {
this.$notify({
title: '成功',
message: "添加成功",
type: 'success',
duration: 2000
});
} else {
this.$notify({
title: '失败',
message: response.message,
type: 'error',
duration: 2000
});
}
this.dialogFormVisible = false; this.dialogFormVisible = false;
this.getList(); this.getList();
this.$notify({
title: '成功',
message: '创建成功',
type: 'success',
duration: 2000
});
}) })
} else { } else {
return false; return false;
...@@ -510,16 +522,25 @@ ...@@ -510,16 +522,25 @@
} else { } else {
this.form.password = undefined; this.form.password = undefined;
} }
putObj(this.form.id, this.form).then(() => { putObj(this.form.id, this.form).then(response => {
if(response.status == 200) {
this.$notify({
title: '成功',
message: '编辑成功',
type: 'success',
duration: 2000
});
} else {
this.$notify({
title: '失败',
message: response.message,
type: 'error',
duration: 2000
});
}
this.dialogFormVisible = false; this.dialogFormVisible = false;
this.getList(); this.getList();
this.form.password = undefined; this.form.password = undefined;
this.$notify({
title: '成功',
message: '编辑成功',
type: 'success',
duration: 2000
});
}); });
} else { } else {
return false; return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment