forked from github/dataease
Merge pull request #3612 from dataease/pr@dev@fix_mobile_share_error
fix(移动端): 没有角色的用户无法查看分享仪表板
This commit is contained in:
commit
77de07b9d6
@ -31,13 +31,20 @@
|
||||
left join sys_user u on u.username = IFNULL(s.granter,g.create_by)
|
||||
where
|
||||
g.mobile_layout = 1 and (
|
||||
( s.target_id = #{userId} and s.type = 0 ) or
|
||||
( s.target_id = #{deptId} and s.type = 2 ) or
|
||||
( s.target_id = #{userId} and s.type = 0 )
|
||||
<if test="deptId != null">
|
||||
or ( s.target_id = #{deptId} and s.type = 2 )
|
||||
</if>
|
||||
|
||||
<if test="roleIds != null">
|
||||
or
|
||||
( s.target_id in
|
||||
<foreach collection="roleIds" item="roleId" open='(' separator=',' close=')'>
|
||||
#{roleId}
|
||||
</foreach>
|
||||
and s.type = 1 )
|
||||
</if>
|
||||
|
||||
)
|
||||
<if test="lastTime != null">
|
||||
and #{lastTime} > s.create_time
|
||||
@ -46,6 +53,4 @@
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
|
@ -11,7 +11,9 @@ import io.dataease.mobile.dto.HomeItemDTO;
|
||||
import io.dataease.mobile.dto.HomeItemShareDTO;
|
||||
import io.dataease.ext.HomeMapper;
|
||||
import io.dataease.mobile.dto.HomeRequest;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@ -47,7 +49,10 @@ public class HomeService {
|
||||
List<Long> roleIds = user.getRoles().stream().map(CurrentRoleDto::getId).collect(Collectors.toList());
|
||||
|
||||
param.put("deptId", deptId);
|
||||
if (CollectionUtils.isNotEmpty(roleIds)) {
|
||||
param.put("roleIds", roleIds);
|
||||
}
|
||||
|
||||
if (null != request.getLastTime()) {
|
||||
param.put("lastTime", request.getLastTime());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user