|
|
@@ -3,6 +3,7 @@ package com.usoftchina.bi.server.service.user;
|
|
|
import com.usoftchina.bi.core.base.BaseContextHolder;
|
|
|
import com.usoftchina.bi.core.base.RepCode;
|
|
|
import com.usoftchina.bi.core.base.RepEntity;
|
|
|
+import com.usoftchina.bi.core.base.RoleConstant;
|
|
|
import com.usoftchina.bi.core.exception.MyException;
|
|
|
import com.usoftchina.bi.core.jdbc.DynamicDataSourceContextHolder;
|
|
|
import com.usoftchina.bi.core.utils.EncryUtil;
|
|
|
@@ -24,6 +25,7 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
|
import java.io.IOException;
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.Iterator;
|
|
|
import java.util.List;
|
|
|
import java.util.stream.Collectors;
|
|
|
@@ -159,7 +161,10 @@ public class UserService {
|
|
|
*/
|
|
|
@Cacheable(value = "userList")
|
|
|
public RepEntity getUserList(){
|
|
|
- List<User> userList = userMapper.getUserList();
|
|
|
+ List<User> userList = new ArrayList<>();
|
|
|
+ if (RoleConstant.SUPER_ADMIN.getRole().equals(BaseContextHolder.getRole())){
|
|
|
+ userList = userMapper.getUserList();
|
|
|
+ }
|
|
|
return new RepEntity(RepCode.success, userList);
|
|
|
}
|
|
|
|
|
|
@@ -208,7 +213,10 @@ public class UserService {
|
|
|
查询用户组
|
|
|
*/
|
|
|
public RepEntity getUserGroup(){
|
|
|
- List<UserGroup> userGroup= userMapper.getUserGroupList();
|
|
|
+ List<UserGroup> userGroup= new ArrayList<>();
|
|
|
+ if (RoleConstant.SUPER_ADMIN.getRole().equals(BaseContextHolder.getRole())) {
|
|
|
+ userGroup= userMapper.getUserGroupList();
|
|
|
+ }
|
|
|
return new RepEntity(RepCode.success, userGroup);
|
|
|
}
|
|
|
|