mirror of
https://gitee.com/fit2cloud-feizhiyun/MeterSphere.git
synced 2024-12-03 20:49:56 +08:00
chore: 修改自定义 http header 名称
This commit is contained in:
parent
7aac30ccf6
commit
453de476d3
@ -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);
|
||||
|
@ -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;
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user