提交 0afc8ce3 编写于 作者: sq3536's avatar sq3536

修改appdata,提供context

上级 675a004d
......@@ -15,10 +15,7 @@ import org.springframework.http.ResponseEntity;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import java.util.*;
@RestController
@RequestMapping(value = "")
......@@ -41,8 +38,9 @@ public class AppController {
Set<String> appMenu = new HashSet();
Set<String> uniRes = new HashSet();
AuthenticationUser curUser = AuthenticationUser.getAuthenticationUser();
if(enablePermissionValid){
Collection<GrantedAuthority> authorities=AuthenticationUser.getAuthenticationUser().getAuthorities();
Collection<GrantedAuthority> authorities=curUser.getAuthorities();
Iterator it = authorities.iterator();
while(it.hasNext()) {
GrantedAuthority authority = (GrantedAuthority)it.next();
......@@ -53,6 +51,10 @@ public class AppController {
appMenu.add(strAuthority.substring(systemId.length()+9));
}
}
Map<String,Object> context = new HashMap<>();
context.putAll(curUser.getSessionParams());
context.put("srfusername",curUser.getPersonname());
appData.put("context",context);
appData.put("unires",uniRes);
appData.put("appmenu",appMenu);
appData.put("enablepermissionvalid",enablePermissionValid);
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册