fix 开启多租户功能后,用户管理中用户只能分配webApp的角色
This commit is contained in:
+12
@@ -1,5 +1,6 @@
|
||||
package com.central.user.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -42,6 +43,17 @@ public class SysRoleController {
|
||||
return sysRoleService.findRoles(params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户管理查询所有角色
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "后台管理查询角色")
|
||||
@GetMapping("/allRoles")
|
||||
public Result<List<SysRole>> findAll() {
|
||||
List<SysRole> result = sysRoleService.findAll();
|
||||
return Result.succeed(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 角色新增或者更新
|
||||
*
|
||||
|
||||
@@ -15,4 +15,6 @@ import org.apache.ibatis.annotations.Param;
|
||||
*/
|
||||
public interface SysRoleMapper extends SuperMapper<SysRole> {
|
||||
List<SysRole> findList(Page<SysRole> page, @Param("r") Map<String, Object> params);
|
||||
|
||||
List<SysRole> findAll();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.central.user.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.central.common.model.PageResult;
|
||||
@@ -28,4 +29,10 @@ public interface ISysRoleService extends ISuperService<SysRole> {
|
||||
* @return Result
|
||||
*/
|
||||
Result saveOrUpdateRole(SysRole sysRole);
|
||||
|
||||
/**
|
||||
* 查询所有角色
|
||||
* @return
|
||||
*/
|
||||
List<SysRole> findAll();
|
||||
}
|
||||
|
||||
+5
@@ -75,4 +75,9 @@ public class SysRoleServiceImpl extends SuperServiceImpl<SysRoleMapper, SysRole>
|
||||
}
|
||||
return Result.succeed("操作成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysRole> findAll() {
|
||||
return baseMapper.findAll();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,4 +32,6 @@ zlt:
|
||||
ignoreTables:
|
||||
- sys_user
|
||||
- sys_role_user
|
||||
- sys_role_menu
|
||||
- sys_role_menu
|
||||
ignoreSqls:
|
||||
- com.central.user.mapper.SysRoleMapper.findAll
|
||||
@@ -2,6 +2,15 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.central.user.mapper.SysRoleMapper">
|
||||
<sql id="Column_List">
|
||||
id,
|
||||
code,
|
||||
name,
|
||||
create_time,
|
||||
update_time,
|
||||
tenant_id
|
||||
</sql>
|
||||
|
||||
<sql id="where">
|
||||
<where>
|
||||
<if test="r.name != null and r.name != ''">
|
||||
@@ -15,8 +24,15 @@
|
||||
</sql>
|
||||
|
||||
<select id="findList" resultType="com.central.common.model.SysRole">
|
||||
select * from sys_role t
|
||||
select <include refid="Column_List"/>
|
||||
from sys_role t
|
||||
<include refid="where" />
|
||||
order by t.id desc
|
||||
order by t.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="findAll" resultType="com.central.common.model.SysRole">
|
||||
select <include refid="Column_List"/>
|
||||
from sys_role
|
||||
order by create_time desc
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user