diff --git a/backend/src/main/java/io/metersphere/commons/utils/SessionUtils.java b/backend/src/main/java/io/metersphere/commons/utils/SessionUtils.java index 30402447ea..c9f04a0cad 100644 --- a/backend/src/main/java/io/metersphere/commons/utils/SessionUtils.java +++ b/backend/src/main/java/io/metersphere/commons/utils/SessionUtils.java @@ -70,9 +70,9 @@ public class SessionUtils { public static String getCurrentWorkspaceId() { try { HttpServletRequest request = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest(); - LogUtil.info("WORKSPACE_ID: {}", request.getHeader("WORKSPACE_ID")); - if (request.getHeader("WORKSPACE_ID") != null) { - return request.getHeader("WORKSPACE_ID"); + LogUtil.info("WORKSPACE: {}", request.getHeader("WORKSPACE")); + if (request.getHeader("WORKSPACE") != null) { + return request.getHeader("WORKSPACE"); } } catch (Exception e) { } @@ -82,9 +82,9 @@ public class SessionUtils { public static String getCurrentProjectId() { try { HttpServletRequest request = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest(); - LogUtil.info("PROJECT_ID: {}", request.getHeader("PROJECT_ID")); - if (request.getHeader("PROJECT_ID") != null) { - return request.getHeader("PROJECT_ID"); + LogUtil.info("PROJECT: {}", request.getHeader("PROJECT")); + if (request.getHeader("PROJECT") != null) { + return request.getHeader("PROJECT"); } } catch (Exception e) { } diff --git a/frontend/src/common/js/ajax.js b/frontend/src/common/js/ajax.js index 837b015905..acc9591c4d 100644 --- a/frontend/src/common/js/ajax.js +++ b/frontend/src/common/js/ajax.js @@ -11,8 +11,8 @@ export function registerRequestHeaders() { config.headers['CSRF-TOKEN'] = user.csrfToken; } // 包含 工作空间 项目的标识 - config.headers['WORKSPACE_ID'] = getCurrentWorkspaceId(); - config.headers['PROJECT_ID'] = getCurrentProjectID(); + config.headers['WORKSPACE'] = getCurrentWorkspaceId(); + config.headers['PROJECT'] = getCurrentProjectID(); return config; }); }