From 3018a0d1e0b3462ab4de34257c41980ea4b68233 Mon Sep 17 00:00:00 2001 From: xing Date: Thu, 18 Jun 2020 11:42:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=80=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/users/users.vue | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/components/users/users.vue b/src/components/users/users.vue index a3f1c29..6939c09 100644 --- a/src/components/users/users.vue +++ b/src/components/users/users.vue @@ -29,7 +29,7 @@ @@ -82,8 +82,13 @@ export default { this.queryInfo.pagenum = val this.getUserList() }, - changeState (state) { - console.log(state) + async changeState (row) { + const { data: res } = await this.$http.put(`users/${row.id}/state/${row.mg_state}`) + if (res.meta.code !== 200) { + row.mg_state = !row.mg_state + return this.$message.error(res.meta.msg) + } + this.$message.success(res.meta.msg) }, async getUserList () { const { data: res } = await this.$http.get('users', {