Browse Source

管理员权限修改

dev
wenlele 2 years ago
parent
commit
c8167edcd6
  1. 7
      api/app/lib/controllers/organization/index.js
  2. 1215
      web/client/src/sections/install/containers/roles.jsx

7
api/app/lib/controllers/organization/index.js

@ -74,7 +74,7 @@ async function editUser (ctx) {
if (existUserRes) {
// 存在且传递id 或者 不传id也存在
// 修改 update
storageData.deleted = false
if (
role.includes('admin')
) {
@ -89,6 +89,8 @@ async function editUser (ctx) {
// 正在修改成员 但是此时还是管理员
storageData.disabled = true
storageData.role = [...role, 'admin']
}else{
storageData.deleted = false
}
await models.User.update(storageData, {
where: {
@ -165,6 +167,9 @@ async function delAdmin (ctx) {
let adminIndex = updateValues.role.findIndex(r => r == 'admin')
if (adminIndex > -1) {
updateValues.role.splice(adminIndex, 1)
if (updateValues.role.length < 1) {
updateValues.deleted = true
}
}
await models.User.update(updateValues, {
where: {

1215
web/client/src/sections/install/containers/roles.jsx

File diff suppressed because it is too large
Loading…
Cancel
Save