|
@@ -9,6 +9,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
import antlr.collections.impl.LList;
|
|
|
import cn.hutool.core.lang.Tuple;
|
|
@@ -162,7 +163,7 @@ public class RestUtil {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public static String control(String param) {
|
|
|
+ public static String control(String param,HttpServletRequest request) {
|
|
|
RepositoryImpl Repository = RepositoryContainer.instance;
|
|
|
JSONObject result = new JSONObject();
|
|
|
try {
|
|
@@ -197,7 +198,7 @@ public class RestUtil {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- JSONArray points = ControlUtil.set(userId, userName, Repository, path, infoValueSet,controlReason);
|
|
|
+ JSONArray points = ControlUtil.set(userId, userName, Repository, path, infoValueSet,controlReason,request);
|
|
|
JSONArray success_points = new JSONArray();
|
|
|
JSONArray failure_points = new JSONArray();
|
|
|
for (int i = 0; i < points.size(); i++) {
|
|
@@ -251,7 +252,8 @@ public class RestUtil {
|
|
|
return JSONObject.toJSONString(result, SerializerFeature.WriteMapNullValue);
|
|
|
}
|
|
|
|
|
|
- public static String subsystem_connect_status(String param) {
|
|
|
+ public static String subsystem_connect_status(String param,HttpServletRequest request) {
|
|
|
+ String authorization=request.getHeader("Authorization");
|
|
|
JSONObject paramObject = JSON.parseObject(param);
|
|
|
String userId = (String) paramObject.get("userId");
|
|
|
String userName = (String) paramObject.get("userName");
|
|
@@ -312,6 +314,10 @@ public class RestUtil {
|
|
|
if (userName != null) {
|
|
|
postParam.put("userName", userName);
|
|
|
}
|
|
|
+ if(authorization!=null)
|
|
|
+ {
|
|
|
+ postParam.put("token", authorization);
|
|
|
+ }
|
|
|
postParam.put("module", "shop");
|
|
|
postParam.put("systemType", "connectionstatus");
|
|
|
postParam.put("details", sb.toString());
|
|
@@ -455,7 +461,7 @@ public class RestUtil {
|
|
|
// http://39.102.40.239:28888/labsl/graph/pub/query
|
|
|
// String post_url ="http://39.102.40.239:28888"+ "/labsl/graph/pub/query";
|
|
|
String post_url = Constant.adm_project_url + "/labsl/graph/pub/query";
|
|
|
- String post_result = HttpClientUtil.instance("adm").post(post_url, postJSON.toJSONString(), null, head);
|
|
|
+ String post_result = HttpClientUtil.instance("adm").post(post_url, postJSON.toJSONString(), null, head,null,null);
|
|
|
// 4.解析返回结果
|
|
|
JSONObject resultJSON = JSON.parseObject(post_result);
|
|
|
Map<String, String> map = new ConcurrentHashMap<>();
|
|
@@ -542,11 +548,11 @@ public class RestUtil {
|
|
|
}
|
|
|
|
|
|
// 登录
|
|
|
- public static String login(String param) {
|
|
|
+ public static String login(String param, HttpServletResponse response) {
|
|
|
JSONObject result = new JSONObject();
|
|
|
try {
|
|
|
JSONObject queryCriteria = JSON.parseObject(param);
|
|
|
- String post_result = PersonUtil.Login(queryCriteria);
|
|
|
+ String post_result = PersonUtil.Login(queryCriteria,response);
|
|
|
String respMsg=JSON.parseObject(post_result).getString("respMsg");
|
|
|
JSONObject resultJSON = JSON.parseObject(post_result).getJSONObject("content");
|
|
|
result.put("Content", resultJSON);
|