|
|
@@ -79,8 +79,10 @@ public class EnterpriseServiceImpl implements EnterpriseService {
|
|
|
}
|
|
|
// 设置为本企业管理员
|
|
|
List<Role> adminList = roleDao.findByEnUUAndDesc(enterprise.getUu(), "管理员");
|
|
|
- existRoles.add(adminList.get(0));
|
|
|
- user.setRoles(existRoles);
|
|
|
+ if (!CollectionUtils.isEmpty(adminList)) {
|
|
|
+ existRoles.add(adminList.get(0));
|
|
|
+ user.setRoles(existRoles);
|
|
|
+ }
|
|
|
userDao.save(user);
|
|
|
|
|
|
if (isNew) {
|