|
|
@@ -51,4 +51,36 @@ public class FdKKService {
|
|
|
throw new BusinessException(ResultCode.USER_NOT_LOGIN);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ public Boolean checkNum(String num,String pageType,String token) {
|
|
|
+ if(StringUtils.isBlank(pageType) || StringUtils.isBlank(token) || (StringUtils.isBlank(num) )){
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ Boolean viewAuth = false;
|
|
|
+ Boolean editAuth = false;
|
|
|
+ try {
|
|
|
+ JSONObject jsonObject = fdKKClient.checkCaseAuth(num,"scene",token);
|
|
|
+ Integer code = jsonObject.getInteger("code");
|
|
|
+ if(code != 0){
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ JSONObject data = jsonObject.getJSONObject("data");
|
|
|
+ viewAuth = data.getBoolean("viewAuth");
|
|
|
+ editAuth = data.getBoolean("editAuth");
|
|
|
+ }catch (Exception e){
|
|
|
+ log.info("checkCaseAuth-error:",e);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(!viewAuth && !editAuth){
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if(pageType.equals("edit") && !editAuth){
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if(pageType.equals("view") && !viewAuth){
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
}
|