diff --git a/framework/gateway/src/main/java/io/metersphere/gateway/filter/SessionFilter.java b/framework/gateway/src/main/java/io/metersphere/gateway/filter/SessionFilter.java index c65a441ac2..e0461b0276 100644 --- a/framework/gateway/src/main/java/io/metersphere/gateway/filter/SessionFilter.java +++ b/framework/gateway/src/main/java/io/metersphere/gateway/filter/SessionFilter.java @@ -18,7 +18,7 @@ import java.util.Optional; public class SessionFilter implements WebFilter { // 所有模块的前缀 private static final String[] PREFIX = new String[]{"/setting", "/project", "/api", "/performance", "/track", "/workstation", "/ui", "/report"}; - private static final String[] TO_SUB_SERVICE = new String[]{"/license", "/system"}; + private static final String[] TO_SUB_SERVICE = new String[]{"/license", "/system", "/resource"}; private static final String PERFORMANCE_DOWNLOAD_PREFIX = "/jmeter/"; private static final String API_DOWNLOAD_PREFIX = "/api/jmeter/"; diff --git a/framework/sdk-parent/frontend/src/plugins/request.js b/framework/sdk-parent/frontend/src/plugins/request.js index ec0455ace8..d8e73d38fa 100644 --- a/framework/sdk-parent/frontend/src/plugins/request.js +++ b/framework/sdk-parent/frontend/src/plugins/request.js @@ -268,6 +268,14 @@ export const generateShareUrl = (name, shareUrl) => { } } +export const generateModuleUrl = (url) => { + if (window.__POWERED_BY_QIANKUN__) { + return window.location.origin + '/' + packageJSON.name + url; + } else { + return window.location.origin + url; + } +} + export default { install(Vue) { Vue.prototype.$get = get; diff --git a/framework/sdk-parent/sdk/src/main/java/io/metersphere/commons/utils/ShiroUtils.java b/framework/sdk-parent/sdk/src/main/java/io/metersphere/commons/utils/ShiroUtils.java index e38798ce7f..30207e3fff 100644 --- a/framework/sdk-parent/sdk/src/main/java/io/metersphere/commons/utils/ShiroUtils.java +++ b/framework/sdk-parent/sdk/src/main/java/io/metersphere/commons/utils/ShiroUtils.java @@ -17,6 +17,7 @@ public class ShiroUtils { filterChainDefinitionMap.put("/resource/md/get/**", "anon"); filterChainDefinitionMap.put("/resource/ui/get/**", "anon"); + filterChainDefinitionMap.put("/attachment/preview/**", "anon"); filterChainDefinitionMap.put("/*.worker.js", "anon"); filterChainDefinitionMap.put("/signin", "anon"); filterChainDefinitionMap.put("/ldap/signin", "anon"); @@ -90,8 +91,6 @@ public class ShiroUtils { public static void ignoreCsrfFilter(Map filterChainDefinitionMap) { filterChainDefinitionMap.put("/", "apikey, authc"); // 跳转到 / 不用校验 csrf filterChainDefinitionMap.put("/language", "apikey, authc");// 跳转到 /language 不用校验 csrf - filterChainDefinitionMap.put("/test/case/file/preview/**", "apikey, authc"); // 预览测试用例附件 不用校验 csrf - filterChainDefinitionMap.put("/attachment/preview/**", "apikey, authc"); // 预览缺陷及测试用例附件 不用校验 csrf filterChainDefinitionMap.put("/mock", "apikey, authc"); // 跳转到 /mock接口 不用校验 csrf } diff --git a/test-track/frontend/src/business/case/components/TestCaseFile.vue b/test-track/frontend/src/business/case/components/TestCaseFile.vue index bf292c8576..662752526e 100644 --- a/test-track/frontend/src/business/case/components/TestCaseFile.vue +++ b/test-track/frontend/src/business/case/components/TestCaseFile.vue @@ -1,7 +1,7 @@