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 () {