mirror of https://github.com/jeecgboot/jeecg-boot
新建用户会自动分配角色 #454
parent
5fe9508428
commit
b970af00c1
|
@ -1013,7 +1013,7 @@ public class SysUserController {
|
||||||
user.setStatus(CommonConstant.USER_UNFREEZE);
|
user.setStatus(CommonConstant.USER_UNFREEZE);
|
||||||
user.setDelFlag(CommonConstant.DEL_FLAG_0);
|
user.setDelFlag(CommonConstant.DEL_FLAG_0);
|
||||||
user.setActivitiSync(CommonConstant.ACT_SYNC_0);
|
user.setActivitiSync(CommonConstant.ACT_SYNC_0);
|
||||||
sysUserService.addUserWithRole(user,"ee8626f80f7c2619917b6236f3a7f02b");//默认临时角色 test
|
sysUserService.addUserWithRole(user,null);
|
||||||
result.success("注册成功");
|
result.success("注册成功");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
result.error500("注册失败");
|
result.error500("注册失败");
|
||||||
|
|
|
@ -633,18 +633,6 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//update-begin---author:wangshuai ---date:20230112 for:用户创建的时候增加临时角色 test------------
|
|
||||||
//开启租户saas模式
|
|
||||||
if (MybatisPlusSaasConfig.OPEN_SYSTEM_TENANT_CONTROL) {
|
|
||||||
String testRoleId = "ee8626f80f7c2619917b6236f3a7f02b";
|
|
||||||
//如果前台没有传递角色或者传过来的劫色没有临时角色,那么默认临时角色 test
|
|
||||||
if (oConvertUtils.isEmpty(selectedRoles) || !selectedRoles.contains(testRoleId)) {
|
|
||||||
SysUserRole userRole = new SysUserRole(user.getId(), testRoleId);
|
|
||||||
sysUserRoleMapper.insert(userRole);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//update-end---author:wangshuai ---date:20230112 for:用户创建的时候增加临时角色 test------------
|
|
||||||
|
|
||||||
//step.3 保存所属部门
|
//step.3 保存所属部门
|
||||||
if(oConvertUtils.isNotEmpty(selectedDeparts)) {
|
if(oConvertUtils.isNotEmpty(selectedDeparts)) {
|
||||||
String[] arr = selectedDeparts.split(",");
|
String[] arr = selectedDeparts.split(",");
|
||||||
|
|
Loading…
Reference in New Issue