From 522526a02be08e2df63291158f145f248c3fcc78 Mon Sep 17 00:00:00 2001 From: xing Date: Thu, 18 Jun 2020 17:00:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=94=A8=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/users/users.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/users/users.vue b/src/components/users/users.vue index ebf88b0..f97ed9a 100644 --- a/src/components/users/users.vue +++ b/src/components/users/users.vue @@ -142,11 +142,17 @@ export default { this.resetForm() }, submitForm () { - this.$refs.addFormRef.validate(validate => { + this.$refs.addFormRef.validate(async validate => { if (!validate) { return } + const { data: res } = await this.$http.post('users', this.addForm) + if (res.meta.status !== 201) { + return this.$message.error(res.meta.msg) + } + this.$message.success(res.meta.msg) this.dialogVisible = false + await this.getUserList() }) }, resetForm () {