|
@@ -27,6 +27,7 @@ import com.jeesite.modules.sso.entity.SsoApp;
|
|
import com.jeesite.modules.sso.service.SsoAppService;
|
|
import com.jeesite.modules.sso.service.SsoAppService;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
|
+import java.util.Comparator;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.UUID;
|
|
import java.util.UUID;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
@@ -91,6 +92,9 @@ public class SsoAppController extends BaseController {
|
|
public Page<SsoApp> listData(SsoApp ssoApp, HttpServletRequest request, HttpServletResponse response) {
|
|
public Page<SsoApp> listData(SsoApp ssoApp, HttpServletRequest request, HttpServletResponse response) {
|
|
ssoApp.setPage(new Page<>(request, response));
|
|
ssoApp.setPage(new Page<>(request, response));
|
|
Page<SsoApp> page = ssoAppService.findPage(ssoApp);
|
|
Page<SsoApp> page = ssoAppService.findPage(ssoApp);
|
|
|
|
+ List<SsoApp> list = page.getList();
|
|
|
|
+ list=list.stream().sorted(Comparator.comparing(SsoApp::getCreateDate).reversed()).collect(Collectors.toList());
|
|
|
|
+ page.setList(list);
|
|
return page;
|
|
return page;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -213,16 +217,38 @@ public class SsoAppController extends BaseController {
|
|
ssoApp.setAppStatus("0");
|
|
ssoApp.setAppStatus("0");
|
|
List<SsoApp> list = ssoAppService.findList(ssoApp);
|
|
List<SsoApp> list = ssoAppService.findList(ssoApp);
|
|
List<SsoApp> list1=new ArrayList<>();
|
|
List<SsoApp> list1=new ArrayList<>();
|
|
- for (Role role : roleList) {
|
|
|
|
|
|
+
|
|
|
|
+ if(user.getUserCode().equals("system")){
|
|
|
|
+ return list;
|
|
|
|
+ }
|
|
for (SsoApp app : list) {
|
|
for (SsoApp app : list) {
|
|
|
|
+ for (Role role : roleList) {
|
|
if(app.getAuthority().contains(role.getRoleCode())){
|
|
if(app.getAuthority().contains(role.getRoleCode())){
|
|
list1.add(app);
|
|
list1.add(app);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ list1=list1.stream().distinct().collect(Collectors.toList());
|
|
return list1;
|
|
return list1;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+ @RequestMapping("/findAuthority")
|
|
|
|
+ @ResponseBody
|
|
|
|
+ public List<String> findAuthority(String id){
|
|
|
|
+ SsoApp ssoApp=new SsoApp();
|
|
|
|
+ ssoApp.setId(id);
|
|
|
|
+ List<SsoApp> list = ssoAppService.findList(ssoApp);
|
|
|
|
+
|
|
|
|
+ List<String> result=new ArrayList<>();
|
|
|
|
+
|
|
|
|
+ String[] split = list.get(0).getAuthority().split(",");
|
|
|
|
+ for (String s : split) {
|
|
|
|
+ result.add(s);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return result;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|