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

Merge remote-tracking branch 'origin/dev' into dev

...@@ -11,23 +11,29 @@ import org.springframework.util.ObjectUtils; ...@@ -11,23 +11,29 @@ import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.springframework.beans.factory.annotation.Value;
import ${pub.getPKGCodeName()}.util.security.AuthenticationUser; import ${pub.getPKGCodeName()}.util.security.AuthenticationUser;
@RestController @RestController
@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 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册