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 80200a5e12..0a9064f341 100644 --- a/backend/src/main/java/io/metersphere/commons/utils/SessionUtils.java +++ b/backend/src/main/java/io/metersphere/commons/utils/SessionUtils.java @@ -71,9 +71,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) { LogUtil.error(e.getMessage(), e); @@ -84,9 +84,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) { LogUtil.error(e.getMessage(), 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; }); }