This commit is contained in:
苏尹岚
2021-01-20 14:25:46 +08:00
parent 15068e28f9
commit 142990b2a6

View File

@@ -163,7 +163,6 @@ func UpdateUserRole(ctx *jxcontext.Context, userIDs []string, roleIDs []int) (er
userRoleMap[v.UserID] = append(userRoleMap[v.UserID], v.RoleID)
}
}
fmt.Println("userRoleMap", userRoleMap)
for _, userID := range userIDs {
nowRoleIDs := userRoleMap[userID]
for _, nowRoleID := range nowRoleIDs {
@@ -172,16 +171,12 @@ func UpdateUserRole(ctx *jxcontext.Context, userIDs []string, roleIDs []int) (er
}
nowRoleIDMap[nowRoleID] = 1
}
fmt.Println("nowRoleIDMap", nowRoleIDMap)
fmt.Println("roleIDMap", roleIDMap)
for roleID, _ := range roleIDMap {
if nowRoleIDMap[roleID] == 0 {
addUserRoleMap[userID] = append(addUserRoleMap[userID], roleID)
}
}
}
fmt.Println("1 ", addUserRoleMap)
fmt.Println("2 ", deleteUserRoleMap)
dao.Begin(db)
defer func() {
if r := recover(); r != nil {
@@ -250,7 +245,7 @@ func UpdateRoleMenu(ctx *jxcontext.Context, roleIDs, menuIDs []int) (err error)
}
nowMenuIDMap[nowMenuID] = 1
}
for _, menuID := range menuIDMap {
for menuID, _ := range menuIDMap {
if nowMenuIDMap[menuID] == 0 {
addRoleMenuMap[menuID] = append(addRoleMenuMap[menuID], menuID)
}