Forráskód Böngészése

修改group_code和project_id必须在url路径上传

yanguofeng 2 éve
szülő
commit
a5856af769

+ 4 - 3
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/interceptor/AppContextInterceptor.java

@@ -1,7 +1,6 @@
 package com.persagy.adm.server.custom.interceptor;
 
 import com.persagy.dmp.common.constant.ResponseCode;
-import com.persagy.dmp.common.context.AppContext;
 import com.persagy.dmp.common.exception.BusinessException;
 import org.apache.commons.lang.StringUtils;
 import org.springframework.stereotype.Component;
@@ -15,8 +14,10 @@ public class AppContextInterceptor extends HandlerInterceptorAdapter {
 
     @Override
     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
-        if(StringUtils.isBlank(AppContext.getContext().getGroupCode()) || StringUtils.isBlank(AppContext.getContext().getProjectId())){
-            throw new BusinessException(ResponseCode.A0402.getCode(),ResponseCode.A0402.getDesc());
+        String groupCode = request.getParameter("groupCode");
+        String projectId = request.getParameter("projectId");
+        if(StringUtils.isBlank(groupCode) || StringUtils.isBlank(projectId)){
+            throw new BusinessException(ResponseCode.A0402.getCode(),"groupCode或者projectId为null");
         }
         return true;
     }