解决登录时候获取角色的bug

This commit is contained in:
季圣华 2022-02-23 00:11:48 +08:00
parent afda050e41
commit a523080185
5 changed files with 16 additions and 1 deletions

View File

@ -75,6 +75,8 @@ public class TenantConfig {
// 过滤自定义查询此时无租户信息约束出现
if ("com.jsh.erp.datasource.mappers.UserMapperEx.getUserListByUserNameOrLoginName".equals(ms.getId())) {
return true;
} else if ("com.jsh.erp.datasource.mappers.RoleMapperEx.getRoleWithoutTenant".equals(ms.getId())) {
return true;
}
return false;
}

View File

@ -18,4 +18,7 @@ public interface RoleMapperEx {
@Param("name") String name);
int batchDeleteRoleByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]);
Role getRoleWithoutTenant(
@Param("roleId") Long roleId);
}

View File

@ -183,4 +183,8 @@ public class RoleService {
}
return result;
}
public Role getRoleWithoutTenant(Long roleId) {
return roleMapperEx.getRoleWithoutTenant(roleId);
}
}

View File

@ -750,7 +750,7 @@ public class UserService {
if(valueArray.length>0) {
roleId = valueArray[0];
}
Role role = roleService.getRole(Long.parseLong(roleId));
Role role = roleService.getRoleWithoutTenant(Long.parseLong(roleId));
if(role!=null) {
return role.getType();
} else {

View File

@ -35,4 +35,10 @@
</foreach>
)
</update>
<select id="getRoleWithoutTenant" resultType="com.jsh.erp.datasource.entities.Role">
select * from jsh_role
where 1=1
and ifnull(delete_flag,'0') !='1'
and id=#{roleId}
</select>
</mapper>