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', {