提交 20380a7a 编写于 作者: zhouweidong's avatar zhouweidong

权限校验开关

上级 6344f417
...@@ -17,17 +17,22 @@ import ${pub.getPKGCodeName()}.util.security.AuthenticationUser; ...@@ -17,17 +17,22 @@ import ${pub.getPKGCodeName()}.util.security.AuthenticationUser;
@RequestMapping(value = "") @RequestMapping(value = "")
public class AppController { public class AppController {
@Value("${r'${ibiz.enablePermissionValid:false}'}")
boolean enablePermissionValid; //是否开启权限校验
@RequestMapping(method = RequestMethod.GET, value = "/appdata") @RequestMapping(method = RequestMethod.GET, value = "/appdata")
public ResponseEntity<JSONObject> getAppData() { public ResponseEntity<JSONObject> getAppData() {
JSONObject appData = new JSONObject() ; JSONObject appData = new JSONObject() ;
JSONArray uniRes=new JSONArray(); JSONArray uniRes=new JSONArray();
JSONObject userPermission=AuthenticationUser.getAuthenticationUser().getPermissionList(); if(enablePermissionValid){
if(!ObjectUtils.isEmpty(userPermission)){ JSONObject userPermission=AuthenticationUser.getAuthenticationUser().getPermissionList();
uniRes = userPermission.getJSONArray("unires"); if(!ObjectUtils.isEmpty(userPermission)){
uniRes = userPermission.getJSONArray("unires");
}
} }
appData.put("unires",uniRes); appData.put("unires",uniRes);
appData.put("enablepermissionvalid",enablePermissionValid);
return ResponseEntity.status(HttpStatus.OK).body(appData); return ResponseEntity.status(HttpStatus.OK).body(appData);
} }
} }
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册