🐛 用户管理,角色管理问题修复
This commit is contained in:
parent
2b5d49d697
commit
40cded1032
@ -122,7 +122,7 @@
|
|||||||
let _ts = this;
|
let _ts = this;
|
||||||
_ts.$set(_ts, 'dialogVisible', true);
|
_ts.$set(_ts, 'dialogVisible', true);
|
||||||
_ts.$set(_ts, 'title', '编辑角色信息');
|
_ts.$set(_ts, 'title', '编辑角色信息');
|
||||||
_ts.$set(_ts, 'role', roles);
|
_ts.$set(_ts, 'role', role);
|
||||||
},
|
},
|
||||||
updateRole() {
|
updateRole() {
|
||||||
let _ts = this;
|
let _ts = this;
|
||||||
@ -144,20 +144,20 @@
|
|||||||
toggleStatus(index, role) {
|
toggleStatus(index, role) {
|
||||||
let _ts = this;
|
let _ts = this;
|
||||||
let title, status;
|
let title, status;
|
||||||
if (roles.status == 0) {
|
if (role.status == 0) {
|
||||||
title = '禁用';
|
title = '禁用';
|
||||||
status = 1;
|
status = 1;
|
||||||
} else {
|
} else {
|
||||||
title = '启用';
|
title = '启用';
|
||||||
status = 0;
|
status = 0;
|
||||||
}
|
}
|
||||||
_ts.$confirm('确定' + title + '角色 ' + roles.name + '?', '提示', {
|
_ts.$confirm('确定' + title + '角色 ' + role.name + '?', '提示', {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
_ts.$axios.$patch('/api/admin/role/update-status', {
|
_ts.$axios.$patch('/api/admin/role/update-status', {
|
||||||
idRole: roles.idRole,
|
idRole: role.idRole,
|
||||||
status: status
|
status: status
|
||||||
}).then(function (res) {
|
}).then(function (res) {
|
||||||
if (res && res.message) {
|
if (res && res.message) {
|
||||||
|
@ -135,8 +135,8 @@
|
|||||||
},
|
},
|
||||||
handleRole(index, user) {
|
handleRole(index, user) {
|
||||||
let _ts = this;
|
let _ts = this;
|
||||||
_ts.$set(_ts, 'idUser', users.idUser);
|
_ts.$set(_ts, 'idUser', user.idUser);
|
||||||
_ts.$axios.$get('/api/admin/user/' + users.idUser + '/role')
|
_ts.$axios.$get('/api/admin/user/' + user.idUser + '/role')
|
||||||
.then(function (res) {
|
.then(function (res) {
|
||||||
_ts.$set(_ts, 'dialogVisible', true);
|
_ts.$set(_ts, 'dialogVisible', true);
|
||||||
_ts.$set(_ts, 'idRole', res[0].idRole);
|
_ts.$set(_ts, 'idRole', res[0].idRole);
|
||||||
@ -145,20 +145,20 @@
|
|||||||
toggleStatus(index, user) {
|
toggleStatus(index, user) {
|
||||||
let _ts = this;
|
let _ts = this;
|
||||||
let title, status;
|
let title, status;
|
||||||
if (users.status == 0) {
|
if (user.status == 0) {
|
||||||
title = '禁用';
|
title = '禁用';
|
||||||
status = 1;
|
status = 1;
|
||||||
} else {
|
} else {
|
||||||
title = '启用';
|
title = '启用';
|
||||||
status = 0;
|
status = 0;
|
||||||
}
|
}
|
||||||
_ts.$confirm('确定' + title + '用户' + users.nickname + '(' + users.account + ')?', '提示', {
|
_ts.$confirm('确定' + title + '用户' + user.nickname + '(' + user.account + ')?', '提示', {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
_ts.$axios.$patch('/api/admin/user/update-status', {
|
_ts.$axios.$patch('/api/admin/user/update-status', {
|
||||||
idUser: users.idUser,
|
idUser: user.idUser,
|
||||||
status: status
|
status: status
|
||||||
}).then(function (res) {
|
}).then(function (res) {
|
||||||
if (res && res.message) {
|
if (res && res.message) {
|
||||||
|
Loading…
Reference in New Issue
Block a user