@ -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{
}
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, {