From 40cded1032fdb9a8a47bddeca1738b0b6211ffb9 Mon Sep 17 00:00:00 2001 From: x ronger Date: Sun, 18 Oct 2020 17:54:52 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E7=94=A8=E6=88=B7=E7=AE=A1=E7=90=86,?= =?UTF-8?q?=E8=A7=92=E8=89=B2=E7=AE=A1=E7=90=86=E9=97=AE=E9=A2=98=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/admin/roles.vue | 8 ++++---- pages/admin/users.vue | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pages/admin/roles.vue b/pages/admin/roles.vue index cbf4705..612280a 100644 --- a/pages/admin/roles.vue +++ b/pages/admin/roles.vue @@ -122,7 +122,7 @@ let _ts = this; _ts.$set(_ts, 'dialogVisible', true); _ts.$set(_ts, 'title', '编辑角色信息'); - _ts.$set(_ts, 'role', roles); + _ts.$set(_ts, 'role', role); }, updateRole() { let _ts = this; @@ -144,20 +144,20 @@ toggleStatus(index, role) { let _ts = this; let title, status; - if (roles.status == 0) { + if (role.status == 0) { title = '禁用'; status = 1; } else { title = '启用'; status = 0; } - _ts.$confirm('确定' + title + '角色 ' + roles.name + '?', '提示', { + _ts.$confirm('确定' + title + '角色 ' + role.name + '?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { _ts.$axios.$patch('/api/admin/role/update-status', { - idRole: roles.idRole, + idRole: role.idRole, status: status }).then(function (res) { if (res && res.message) { diff --git a/pages/admin/users.vue b/pages/admin/users.vue index 3244ea6..3aff960 100644 --- a/pages/admin/users.vue +++ b/pages/admin/users.vue @@ -135,8 +135,8 @@ }, handleRole(index, user) { let _ts = this; - _ts.$set(_ts, 'idUser', users.idUser); - _ts.$axios.$get('/api/admin/user/' + users.idUser + '/role') + _ts.$set(_ts, 'idUser', user.idUser); + _ts.$axios.$get('/api/admin/user/' + user.idUser + '/role') .then(function (res) { _ts.$set(_ts, 'dialogVisible', true); _ts.$set(_ts, 'idRole', res[0].idRole); @@ -145,20 +145,20 @@ toggleStatus(index, user) { let _ts = this; let title, status; - if (users.status == 0) { + if (user.status == 0) { title = '禁用'; status = 1; } else { title = '启用'; status = 0; } - _ts.$confirm('确定' + title + '用户' + users.nickname + '(' + users.account + ')?', '提示', { + _ts.$confirm('确定' + title + '用户' + user.nickname + '(' + user.account + ')?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { _ts.$axios.$patch('/api/admin/user/update-status', { - idUser: users.idUser, + idUser: user.idUser, status: status }).then(function (res) { if (res && res.message) {